PDA

View Full Version : special insert query


Chris Hunter
01-17-2003, 09:03 PM
hello community. i got following problem:

i have a e-shop script an di want to display the last inserted articles per artiklegroup

my table looks as this:

name, insertdate(timestamp), groupid


if i want to select the last inserted artikles i have following query:

select name from artikel order by insertdate desc

now ill have the last inserted artikles in the result

but i need a query where for every group only the last inserted artikle is displayed without diplicates per group
the above written query results in every artikles but not in one(the last) per group

here an example:

data:

artikel group 2
t-shirts insertdate=13456

artikel group 2
pullover insertdate=13400

artikel group 1
wood insertdatum=13400


the result should look like this:

artikel group 2
t-shirts insertdate=13456

artikel group 1
wood insertdate=13400


how can i solve that. i trie and trie for days now. but i cant fix that damn simple thing.

please help me...