Joe Yoder wrote:
I have data in various tables with this structure:
  Time_Stamp
  Value

I need to combine the tables into this structure:
  Time_Stamp
  ValueFromTable1
  ValueFromTable2
  ValueFromTable3

I have code that does this but expect there is a better way to do it via
SQL.
Does someone want to save me the time of figuring it out?

Thanks in advance,

Assuming the fields are the same type and length, then try this you could,

Select table1.t1value,table2.t2value,table3.t3value ;
 from table1,table2,table3 ;
where table1.time_stamp = table2.time_stamp and table2.time_stamp = table3.time_stamp ;
 into cursor mycurs

Depending on whether there is data in all the tables, an outer join you may need to do.

HTH

Peter

.

This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

www.whisperingsmith.com

Whispering Smith Ltd
Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 
Fax:0161 831 3715
London Office:17-19 Foley Street, London  W1W 6DW Tel:0207 299 7960


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to