select *
from webOrders
where lastModifiedDate in (select max (lastModifiedDate) from webOrders)
Is there a simpler way without nesting the selects?
Doing something like this also results in an error:
select id, amount, quantity, max(lastModifiedDate) from webOrders.
There are a couple of approaches, depending on your needs.
If you only need one row returned, you can sort on the column of interest and return the top row. For example:
if you use SQL Server or
if you use MySQL.
If you need to get one row per group, then you do typically have to use a subquery or a join.