Help with SQL statement
Posted by:
Stuart Roe
Date: August 12, 2005 05:33AM
Guys,
Can anyone help me with a query.
I have two tables:
`User` has 2 colns, user_id (int,pk) and name (char)
`Logins` has 3 colns, `logins_id` (int,pk), `user_id` (int) and `connecttime` (datetime).
Every user has a single entry in `User` and zero or more entries in `Logins`. What is the smallest number of SQL statements to be able get the top 2 (or fewer) connecttime entries from `Logins` for each user_id?
BTW: I'm on MySQL V4.1.12a-nt
Subject
Written By
Posted
Help with SQL statement
August 12, 2005 05:33AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.