tbott1
10-17-02, 15:55
| I have a products table containing the same product of various colors. As a simplified example, these three fields with these three records.. .................................................. ................. prod_name..........prod_desc..........prod_color .................................................. ................. abc.....................abc in black........black abc.....................abc in white........white xyz.....................xyz in red...........red I only want to display each product name once. In my example, I want to only display abc once and xyz one. Here, the SQL statement would be... SELECT DISTINCT prod_name FROM tblProducts ...and I would get 'abc' and 'xyz'. The thing is, I would like to then display all of the fields within the DB, not just the prod_name field. I've tried the following statements, but none of these work... SELECT * FROM tblProducts WHERE EXISTS (SELECT DISTINCT prod_name FROM tblProducts) SELECT DISTINCT prod_name FROM tblProducts WHERE EXISTS (SELECT * FROM tblProducts) SELECT DISTINCT prod_name, prod_desc, prod_color FROM tblProducts What is the SQL statement I am looking for? Thanks. |