I am selecting records mulitple tables as follows
select distinct o.order_id, o.order_date, u.name, a.addressid
from orders o
inner join users u on o.user_id=u.user_id
inner join addresses a on u.user_id=a.user_id
I also want to add a column to the above which contains the max order_id from the above selected records.
How can I acheive this?