The keyword DISTINCT indicates a distinct row that is returned in the query, it cannot be used to return rows that are only distinct on two columns in a query which contains more than the two columns of interest.
-dhs At 03:52 PM 12/12/01 -0500, you wrote: >I'm trying to query the contents of a table based on the combination of 2 >columns being distinct. >So far I have > >SELECT DISTINCT >ColB, ColC >FROM table_1 > >This query pulls the rows I'm looking for, >but now how do I get all the other columns that are in the table? > >I'm trying to get ColA, ColB, ColC, ColD, ColE. > >I tried >SELECT * >FROM table_1 >WHERE EXISTS ( > SELECT DISTINCT > ColB, ColC > FROM table_1) > >But this returns every row. > >Any suggestions? > >Matt > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Get the mailserver that powers this list at http://www.coolfusion.com Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
