Hai,

I am developing a home appliances website. I had a detail database. Which stored the details of all the items in that shop. The columns are Id number, name, price, type, made, date.

When user clicks on the TV menu in the website then the lists of TV in that shop will show. I did that using the mysql query like this select * from data_base where type="TV"; Working fine. Now I need to do a filter search in this page. That is I need to show a list/menu in that page showing all the TV brands in that shop.
How to display all the brands from a database like this

Type----------------Brand----------------Model No
TV----------------Sony ----------------510
TV ----------------AKAI----------------120
TV----------------Sony ----------------150
TV----------------SAMSUNG----------------840
TV ----------------Sony----------------170

Simply I need to display all the tv brands without repeating the name. If I will use this query models will repeat select "Brand" from data_base where type="tv"; ie the result will be like this

Sony
AKAI
Sony
SAMSUNG
Sony

But I want a result like this

Sony
AKAI
SAMSUNG


Thanks in advance
Rajeesh

Use the distinct keyword:

SELECT DISTINCT "column_name" FROM "table_name"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.