On Jun 17, 2014, at 11:01 PM, David M. Cotter <d...@kjams.com> wrote:

> also: if this query isn't *very* fast, then i'm fine with just "give me the 
> value of the first cell where there is data in that column"
> 
> in the below case, i'd get a "1".  
> i would then proceed to delete everything with a "1" in it (from this and 
> other tables)
> then i'd ask again, this time i'd get a 4, repeat above
> then ask again, get nothing, and i'd be done
> 
> On Jun 17, 2014, at 10:54 PM, David M. Cotter <d...@kjams.com> wrote:
> 
>> i have a table with a numeric column (not the key column)
>> i want to obtain from this table a list of unique numbers appearing in that 
>> one column
>> 
>> some cells in the column may have nothing, some may have duplicate numbers 
>> eg:
>> 
>>> 1
>>> 1
>>> 1
>>> 4
>>> _
>>> _
>>> 4
>>> _
>> 
>> note that "_" means "no data".  i want to get a list with [1, 4] as the 
>> result.  what is the proper SQLite query for this?


You want "distinct":
select distinct column from table where column is not null;

or "group by":
select column from table where column is not null group by column;


Regards,
Bradley Giesbrecht (pixilla)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to