If I have a table like this: Table1
ID - sequence - value
1 1 6
1 2 4
2 1 3
2 2 2
3 2 6
4 1 5
5...
Table2:
ID - Firstname
1 Jack
2 John
3 Mark
4 Mary
Querry Result I hope for:
ID - Firstname - seq1value - seq2value
1 Jack 6 4
2 John 3 2
3 Mark NULL 2
4 Mary 5 NULL
5
the statement I have is:
select Table2.ID,Table2.Firstname, day1.seq1value,day2.seq2value from Table2,
(select Table2.ID,Table2.Firstname,Table1.value as seq1value from Table1,Table2
where Table1.ID=Table2.ID and Table1.sequence='1') day1,
(select Table2.ID,Table2.Firstname,Table1.value as seq1value from Table1,Table2
where Table1.ID=Table2.ID and Table1.sequence='2') day2
where Table1.ID=day1.ID and Table2.ID=day2.ID group by Table2.ID;
This skips the records which have a null in them and presents the other records.
How do i get my query to look like the result I hope for?
THank you
HDRG 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.