Hi there,
i´ve got the following SQL-Problem: I am working on a picture gallery and wanted to display the last 6 photos uploaded but only 1 photo per user.
The table have:
--------------------
fotoid, userid, picturename, thumbname, category, dbtimestamp
but the String:
--------------------
SELECT fotoid, userid, picturename, thumbname, category, dbtimestamp FROM gallery WHERE category <> 99 GROUP BY fotoid,userid ORDER BY fotoid DESC LIMIT 0, 6
--------------------
wont work. it displays 2 or more photos from a user...
this one wont work too... gives me an error...
---------------------------------------
SELECT fotoid, userid, picturename, thumbname, category, dbtimestamp FROM gallery WHERE (((fotoid) In (SELECT Max(fotoid) AS Maxfromfotoid, userid FROM gallery GROUP BY userid))) ORDER BY dbtimestamp DESC LIMIT 0, 6
----------------------------------------
any ideas?
thanx for your help