Tabel nr. 1 : tabela_1
id | tekst | nr | czas ------------------------ 0 | ble0 | 1 | 2005.03.01 15:00 1 | ble1 | 1 | 2005.03.02 15:00 2 | ble2 | 1 | 2005.03.03 15:00 3 | ble3 | 1 | 2005.03.04 15:00
Tabel nr. 2 : tabela_2
id | tekst | nr | czas ------------------------ 5 | ble0 | 2 | 2005.03.01 17:00 6 | ble1 | 2 | 2005.03.02 17:00 7 | ble2 | 2 | 2005.03.03 17:00 8 | ble3 | 2 | 2005.03.04 17:00
I chce zeby mi to polaczyl w jedna tabele i posegergowal razem wedlug "czas" oczywiscie dzialajac w petli czyli:
Tabel:
id | tekst | nr | czas ------------------------ 8 | ble3 | 2 | 2005.03.04 17:00 3 | ble3 | 1 | 2005.03.04 15:00 7 | ble2 | 2 | 2005.03.03 17:00 2 | ble2 | 1 | 2005.03.03 15:00 6 | ble1 | 2 | 2005.03.02 17:00 1 | ble1 | 1 | 2005.03.02 15:00 5 | ble0 | 2 | 2005.03.01 17:00 0 | ble0 | 1 | 2005.03.01 15:00
zrobilem cos takiego co mi wyciag dane z obu tablei w jednym zapytaniu ale cos nie chce sortowac. Dodalem tam miezy innymi "ORDER BY tabela_1.czas AND tabela_2.czas" ale nic nie dalo ;]. Wogole probowalem na wiele spospobow ale nic nie dziala


SELECT tabela_1.id, tabela_1.tekst, tabela_1.nr, tabela_1.czas, tabela_2.id, tabela_2.tekst, tabela_2.nr, tabela_3.czas, FROM tabela_1, tabela_2 ORDER BY {}
DESC
ThX