It is possible to join the tables because there is a related id in one of the tables. But a JOIN or table1.id = table2.id didn't work, I get syntax errors. But I think I will let it this way, it works great now!
Thanks,
Vncent
Great, that was what I was looking for!
It is now working (with a little trial and error), but in my situation there are two tables involved. One with the Dates and one with the Cities. Is there a way to join those two tables? I have done it now the quick and dirty way with 5 individual select...
It isn't that simple... because then you get AMSTERDAM, NEW YORK and then ZAGREB and that is not the right sequence because ZAGREB should appear before NEW YORK because it has a nearer Date.
Thanks namlian!
Is the suggestion of namlian the only option to solve this? I prefer to not do this, but if it is the only way, I have to do it.
Or is still a single select statement possible?
In that case it is for me not really important which City then gets the priority, as long as they are not mixed up. So first City 1 and then City 2. And if I have to choose, I prefer alfabetical order.
I have trouble getting the data in the right order from a table with the columns Date and City:
APRIL 8 2010 | AMSTERDAM
APRIL 9 2010 | ZAGREB
APRIL 10 2010 | AMSTERDAM
APRIL 11 2010 | NEW YORK
APRIL 15 2010 | NEW YORK
I want to have the record with the nearest Date in the future on the top...