djp1988 Posted June 2, 2008 Share Posted June 2, 2008 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 More sharing options...
king Posted June 3, 2008 Share Posted June 3, 2008 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 More sharing options...
djp1988 Posted June 3, 2008 Author Share Posted June 3, 2008 well it selects the entry 51 before the order by so it doesn't make any difference Link to comment Share on other sites More sharing options...
justsomeguy Posted June 3, 2008 Share Posted June 3, 2008 The example you posted isn't going to work with group by so it's hard to see what you're doing. Post the actual query you're using. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.