Combining two row into one

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



hi,

iam trying to make a query which will return 1 row with n+n columns
from 2 rows(same table) with n columns each.

the initial table structure would be like this-

Code:
--------------------
    date | 12 am | 1 am | 2am | ....... | 11 pm
--------------------


& finally the table should be like

Code:
--------------------
    date | 12 am | 1 am | 2am | ....... | 11 pm | x12am | x1 am | x2am | ....... | x11 pm 
--------------------
 

so basically combining two rows from 1st table to 1 row (in new
table/or otherwise)...
i am using VB to execute this query.....so i can construct the query in
VB & then execute it....

-edit:-
actually dont care by column names in 2nd table


sub topic:
the main problem is that....sometimes i need few columns from 1 row and
few from another......
for eg - 
on 2/1/2006 - need columns 21pm | 22pm | 23pm      <- this is 1 row
while on 2/2/2006 - need columns 12 am | 1 am | 2am | 3am | 4am | 5am  
<- 2nd row
i need to combine both these rows & display 1 row with only those
columns....

Trust iam clear. :confused: 

TIA


-- 
Rajat
------------------------------------------------------------------------
Rajat's Profile: http://www.hightechtalks.com/m876
View this thread: http://www.hightechtalks.com/t2349003

.



Relevant Pages

  • UnicodeEncode Error ?
    ... iam getting the below error. ... return self.cursor.execute(sql, params) ... base.py", line 83, in execute ... query = query % db.literal ...
    (comp.lang.python)
  • Re: Problem with floating point render target with z-buffer
    ... Occolusion query doesn't return the value immidiately, ... > Iam having problem with outputing z - value in pixel shader. ... > caps show that rendertarget and depthstencil formats set are compatible. ... > previous pass in 128-bit render target. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Regarding Left shift operator in embedded processor
    ... > processor for one of my application also Iam using a cross compiler ... I have a query regarding left shift ... > I got this expression compiled,but Iam not sure about the results I ... The C standard specifies how implicit type coercion will operate, ...
    (comp.arch.embedded)
  • Re: Drill up members
    ... Actually iam working on AS2000 server & iam not able to run your sample ... In my case i do not know to which level it should rollup. ... The mdx query should rollup to a level with that level hierarchy ... With just the above data from a mdx query i should be able to get ...
    (microsoft.public.sqlserver.olap)
  • Size of class again
    ... Iam putting my query again as i lost replies to my last messages. ... whats is the size of an empty class. ...
    (microsoft.public.vc.language)