Jump to content

GROUP BY problem


djp1988

Recommended Posts

SELECT *FROM tableWHERE strict_name = 'ThisField'GROUP BY strict_nameORDER BY n_data DESC

I have more then 1 lines for strict_name = 'ThisField' ranging from (primary key) 49 to 54with the SQL i show you what I aim to get is to get one line with the first primary key (49) and for some reason i get number 51 :|Can someone explain to me why?And help me ! :)

Link to comment
Share on other sites

Maybe because of the ORDER BY n_data desc; which may cause the PRIMARY KEY (51) to appear first in the order?Try executing the query omitting the ORDER BY clause.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...