| Author |
Topic |
|
swatib
Posting Yak Master
173 Posts |
Posted - 2007-07-02 : 04:58:58
|
HI All, i have a table in which there are 2 records each time:From Date, To Date, Type, dataindentified, dataocuured1-jul-07,2-jul-07,A,45,301-jul-07,2-jul-07,B,12,11I want the result of query as follow:From Date, To Date, Type, dataindentified, dataocuured,Type, dataindentified, dataocuured1-jul-07,2-jul-07,A,45,30,B,12,11 Result should be a single row. please help me.Njoy Life  |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-02 : 05:05:57
|
what is the Primary Key of this table ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2007-07-02 : 06:07:12
|
Maybe something like:SELECT T1.FromDate, T1.ToDate ,T1.Type, T1.dataidentified, T1,dataoccurred ,T2.Type, T2.dataidentified, T2,dataoccurredFROM YourTable T1 JOIN YourTable T2 ON T1.FromDate = T2.FromDate AND T1.ToDate = T2.ToDate AND T1.Type < T2.Type |
 |
|
|
johnsql
Posting Yak Master
161 Posts |
Posted - 2007-10-26 : 11:21:17
|
quote: Originally posted by Ifor Maybe something like:SELECT T1.FromDate, T1.ToDate ,T1.Type, T1.dataidentified, T1,dataoccurred ,T2.Type, T2.dataidentified, T2,dataoccurredFROM YourTable T1 JOIN YourTable T2 ON T1.FromDate = T2.FromDate AND T1.ToDate = T2.ToDate AND T1.Type < T2.Type
This is far away from OP's request. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-10-29 : 03:24:26
|
quote: Originally posted by swatib HI All, i have a table in which there are 2 records each time:From Date, To Date, Type, dataindentified, dataocuured1-jul-07,2-jul-07,A,45,301-jul-07,2-jul-07,B,12,11I want the result of query as follow:From Date, To Date, Type, dataindentified, dataocuured,Type, dataindentified, dataocuured1-jul-07,2-jul-07,A,45,30,B,12,11 Result should be a single row. please help me.Njoy Life 
Where do you want to show the data?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|