Query untuk memilih max(date) dari satu tabel

Database dan Structured Query Language

RE: Query untuk memilih max(date) dari satu tabel

Postby iwancs » 21 Dec 2010, 17:29

niksenh wrote:kalo kaya gini gmana?

SELECT a.idrecord, a.iduser, a.tgl_login
FROM myTable a
JOIN (SELECT iduser, MAX(tgl_login) AS tgl_login FROM myTable GROUP BY iduser ORDER BY iduser) b
ON a.iduser = b.iduser
AND a.tgl_login = b.tgl_login


Hebat, itu benar sekali, persis seperti yang diperlukan. hmmmm yakin neh newbi :cool:
iwancs
Junior Member
 
Posts: 5
Joined: 27 Oct 2010, 22:23

Previous

Who is online

Users browsing this forum: No registered users and 1 guest

cron