SELECT * FROM orders WHERE (SELECT MAX(day)) = (SELECT MAX(day_of_order)) FROM orders
2 replies to this topic
#1
Posted 01 January 2011 - 11:28 PM
Is it possible that I use this
|
|
|
#2
Posted 02 January 2011 - 01:45 AM
Not like you wrote it, with 2 separate SELECTS you can:
Note that this will select every row from the orders table if it is true.
WHERE (SELECT MAX(day) FROM orders) = (SELECT MAX(day_of_order) FROM orders)
Note that this will select every row from the orders table if it is true.
#3
Posted 02 January 2011 - 05:08 AM
Although popular db nowadays already support it, but first you must check your database to see if it's supporting subquery. And if it supports subquery, I believe you must rephrase your query, just like win DC mentioned. Maybe you could explain what are you trying to achieve using subquery?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









