Re: [sqlite] select by min di

2009-03-29 Thread Igor Tandetnik
"baxy77bax"  wrote in
message news:22767988.p...@talk.nabble.com
> hi ,
> i need help with this one : i have a table with 2 columns C1 & C2:
>
> C1   C2
>
> a  1
> b  1
> b  2
> b  4
> c  3
> v  2
> c  5
> d  5
>
> and i need to get this:
>
> C1  C2
>
> a  1
> b  1
> c  3
> d  5
> v  2
>
> so a unique set of data in column C1 where C2 is the min id for that
> data ?

select C1, min(C2) from mytable
group by C1;

Igor Tandetnik 



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


[sqlite] select by min di

2009-03-29 Thread baxy77bax

hi , 
i need help with this one : i have a table with 2 columns C1 & C2:

C1   C2

a  1
b  1
b  2
b  4
c  3
v  2
c  5
d  5

and i need to get this:

C1  C2
 
a  1
b  1
c  3
d  5
v  2

so a unique set of data in column C1 where C2 is the min id for that data ?


thank you !


-- 
View this message in context: 
http://www.nabble.com/select-by-min-di-tp22767988p22767988.html
Sent from the SQLite mailing list archive at Nabble.com.

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