select distinct On multiple fields
-
Hi i want to know how to do a "select distict" on multiple field. for example suppuse we have a table with field FirstName and LastName. and we want to select all distinct the people in this table with a Query with distinct FName and LName. I know i can use other elegant ways (such as relationship) to do so, but i need to know that query. thanks
-
Hi i want to know how to do a "select distict" on multiple field. for example suppuse we have a table with field FirstName and LastName. and we want to select all distinct the people in this table with a Query with distinct FName and LName. I know i can use other elegant ways (such as relationship) to do so, but i need to know that query. thanks
Distinct keyword is associated with one row, not with one column. So you can't get distinct rows on the base of two columns.
Sushant Duggal.
-
Hi i want to know how to do a "select distict" on multiple field. for example suppuse we have a table with field FirstName and LastName. and we want to select all distinct the people in this table with a Query with distinct FName and LName. I know i can use other elegant ways (such as relationship) to do so, but i need to know that query. thanks
Hello, Did u try group by clause? If not then u may write in the following way to get the distinct value. SELECT FName,LName FROM YourTableName group by FName,LName
Mehedi Hasan
-
Hi i want to know how to do a "select distict" on multiple field. for example suppuse we have a table with field FirstName and LastName. and we want to select all distinct the people in this table with a Query with distinct FName and LName. I know i can use other elegant ways (such as relationship) to do so, but i need to know that query. thanks
-
Hello, Did u try group by clause? If not then u may write in the following way to get the distinct value. SELECT FName,LName FROM YourTableName group by FName,LName
Mehedi Hasan
I was talking about the distinct keyword. Perhaps, thanks for the query. Regards,
Sushant Duggal.