Yes that works. Thanks a lot!
Now what if I want to get not only user_id, but the full record of the
user, which is in another table called users. The following query
doesn't seem to work
select users.id, users.*, max(orders.order_time) from users join orders
on users.id=orders.user_id grou
Hi Yes that works too. Many Thanks!
Now as you have probably , what I really want to get the full record of
the user, which is in another table called users. The following query
doesn't seem to work
select users.id, users.* from users join orders on
users.id=orders.user_id group by users.id
On Wed, Oct 6, 2010 at 3:34 AM, Min Yin wrote:
> Hi Yes that works too. Many Thanks!
>
> Now as you have probably , what I really want to get the full record of the
> user, which is in another table called users. The following query doesn't
> seem to work
>
> select users.id, users.* from users j
On Tue, Oct 5, 2010 at 10:26 PM, Min Yin wrote:
> Hi There,
>
> I have a table looks like this:
>
> (order_id, user_id, order_time)
>
> One user_id can have multiple orders with order_id as the primary key, now I
> want to get a list of users, ordered by their latest order respectively, for
> exa
Hi There,
I have a table looks like this:
(order_id, user_id, order_time)
One user_id can have multiple orders with order_id as the primary key,
now I want to get a list of users, ordered by their latest order
respectively, for example, if user A has two orders, one on today, the
other a mo