SQL question
- From: andris_sh@xxxxxxxxx
- Date: 28 Dec 2005 00:28:05 -0800
Hi, all.
I am working with Sybase AS IQ 12.6.
Situation - I have several tables, containing date fields:
table1(start_date, end _date, id1, id2)
table2(start_date, end _date, id1, id2)
table3(start_date, end _date, id1, id2)
table4(start_date, end _date, id1, id2)
table5(start_date, end _date, id1, id2)
I need to get minimal start_date value from all of those tables and
maximal end _date value
from all tables. Result would be longest data period, described by
those two fields across all tables.
It would be great, if I could solve at least this.
Final task is to get combination in such hierarchy : id1 ->id2 ->
period, like having selected longest time periods for each id2 and id1
combination (id1 and id2 is in one-to-many relationship)
Any helpful ideas?
Thanks!
.
- Prev by Date: Re: Capture return from sybase in shell script
- Next by Date: simple distinct question
- Previous by thread: Data replication - ASE -> Sybase IQ
- Next by thread: simple distinct question
- Index(es):
Relevant Pages
|