Forum Moderators: open

Message Too Old, No Replies

select same field as two names

         

ayushchd

10:19 am on Apr 11, 2008 (gmt 0)

10+ Year Member



Hi guys, I want to select the distinct value of a field (category) as two names -> value and label

How do I do It?

SELECT distinct(category) as label, distince(category) as value from mldc_stocks;

This one doesn't work.
Please help!

Demaestro

4:10 pm on Apr 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you only need the distinct once.

SELECT distinct(category) as label, (category) as value from mldc_stocks;

ayushchd

5:00 pm on Apr 11, 2008 (gmt 0)

10+ Year Member



thanks