|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Joins
hi i have a table in my database which is for news for a site i am making a CMS for and they want date and time displaying seperatly eg:
On: DD-MM-YYYY At: 00-00-00 so i have 2 fields in the table (date and time) date is set to date and time is set to time and i want to order news by date and time (when displayed) At the moment im ordering news by ID not by time so to order by time i need to join date with time i know how to perform joins but would LEFT OUTER JOIN be the best join to use? If not does anyone know another join that would be useful? |
|
#2
|
|||
|
|||
|
RE: Joins
Well, what is the common field you are going to join? Are you joining by the ID? Then a LEFT JOIN should do the trick.
|
|
#3
|
|||
|
|||
|
RE: Joins
If the date and time fields are in the same table, there is no need to do a join, you just need to specify both date and time in the order by clause like so.
SELECT * FROM NEWS ORDER BY date, time That will output the records in date/time order, give it a try... |
|
#4
|
|||
|
|||
|
RE: Joins
oh, silly me, I thought he said he had date and time in two separate tables....hmmm.
|
|
#5
|
||||
|
||||
|
RE: Joins
ok thanks
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Joins |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|