views:

31

answers:

1

Is it possible to get unique results of 2 different fields in 1 query?

Ex. Table Criminal

  • Criminal name
  • Id No
  • No of Crimes in Past
  • father name
  • state

is it posible to get Criminal having distinct value (No of Crimes) in Past and distinct name in a single query?

means crime No also should unique and name is also uniqe.

+1  A: 

Yes, you can have multiple distinct values in a query:

SELECT
 [Criminal name],
 [No of Crimes in Past]
GROUP BY 
 [Criminal name],
 [No of Crimes in Past]
Chris Pebble
Strictly speaking this won't give you distinct values in each column but rather distinct pairs. That may be what the OP wants, though; it's unclear.
tvanfosson