You are here: Help with query - strange behaviour « PHP SQL « IT news, forums, messages
Help with query - strange behaviour

Posted by rukkie on 12/19/06 12:12

Hi,

I have a MySql database in which I have 2 columns of which I want to
make a list of all the distinct values from both columns. The 2nd
column can be empty if the first one is filled in ; if the 1st column
is filled in, then the 2nd column is by default also empty.Also the
distinct values should be in alphabetical order

I'm using this query :

$query5="SELECT DISTINCT col1,col2 FROM db WHERE (col1<>\" \") ORDER BY
col1,col2 asc";

But this is not working at all ... I got double entries and the list is
not correctly sorted ...

Has anyone out there some idea on how to get a sorted list of only the
distinct values of both columns ?

A newbie should be very happy with it ...

Thanks in advance !!

 

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

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