Query Problem
I have a problem by designing a query for mysql.
i have two tables like these one:
table1:
Number;ClientID;DateBeginn;DateEnd;Data
1;1;20050101;20050102;A
2;1;20050102;20050104;B
3;1;20050104;20050105;C
table2:
ClientID;Name;Surname;
1;Test;Test
I want to design three querrys:
The first one:
Give me for each client in table2 his name and surename and give me for this client the data in table2 which is the oldest one (from beginn)
Solution: 1;Test;Test;A
The second one:
Give me for each client in table2 his name and surename and give me for this client the data in table2 which is the newest one (from beginn)
Solution: 1;Test;Test;C
The third one:
Give me for each client in table2 his name and surename and give me for this client the data in table2 which difference (dateend - datebeginn) is the biggest.
Solution: 1;Test;Test;B
Can anybody help me to design these querys?
THX a lot
Subject
Written By
Posted
Query Problem
August 04, 2005 07:30AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.