You are here: Re: slightly OT, sql question « PHP Language « IT news, forums, messages
Re: slightly OT, sql question

Posted by Hilarion on 11/10/70 11:24

> > SELECT MIN( id ) AS res_id
> > FROM some_table
> > GROUP BY prod_nr
> > ORDER BY 1

> Thank you very much!

No problem.


> Without the ordering works great.

Should also work with ordering (if you need it), but
depending on SQL engine you are using you may have to
change "ORDER BY 1" to "ORDER BY res_id" or
"ORDER BY MIN( id )".


Hilarion

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация