aviddv1 Posted November 22, 2006 Share Posted November 22, 2006 Hey there,I've got two tables. One table is called 'Press' the other is called 'News'. Both tables have a datetime field. I want to query both tables and return the record with most recent datetime. Other than the datetime field none of the fields match.Thanks,ward Quote Link to comment Share on other sites More sharing options...
printf Posted November 22, 2006 Share Posted November 22, 2006 Something like...[code](SELECT * FROM News) UNION (SELECT * FROM Press) ORDER BY date_time_column_name DESC LIMIT 1;[/code]if the [b]date_time_column_name[/b] names are not the same, then comma separate them in the ORDER BY clause.printf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.