Re: Display only one filed of the repeated records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, 30 Nov 2004, Ahmed Abdel-Aliem wrote:

> Hi,
> i have a tables in database which fields is
> id - title - category
>
> what i want to do is to display the categories entered in the
> categories fields, without repeating any of them
> for eample if the records is like follow
>
> ID          Title               Cattegory
> 1            Matrix           Sci-Fi
> 2            Spartacus     History
> 3            Alexander     History
> 4            whatever       Horror
>
> i want to list the categories only like this
>
> Sci-Fi - History - Horror
>
> can anyone help me throught this please ?

 Use DISTINCT in your query, maybe?

 SELECT DISTINCT Cattegory from tablename;

 Hope that helps.

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux