如何在sql的特定列中选择所有列而不重复任何列

时间:2013-03-01 03:12:23

标签: sqlite

我需要选择在特定列中具有不同值的任何记录的所有列,所以如果我有

Firts|Last|State|
Jacck|Redy|NJ
Jacck|Redy|NJ
Jacck|Redy|NY
Jacck|Redy|NY
Jacck|Redy|OH
Jacck|Redy|OH

我想得到

 Jacck|Redy|NJ
 Jacck|Redy|NY
 Jacck|Redy|OH

1 个答案:

答案 0 :(得分:0)

 select first, last, state from table1 GROUP BY first, last, state

OR

 select distinct first, last,state from table1