Scholz Maik (CM-AI/PJ-CF42) <maik.sch...@de.bosch.com> wrote:
> I am little bit confused about filtering SQL query's.
> 
> My table:
> ROWID   V       A       B
> ===================
> 1       0       0       1
> 2       0       0       2
> 3       0       1       1
> 4       0       1       2
> 5       1       0       2
> 6       2       0       2
> 
> With my SQL knowledge I am able filter the result
> Like this:
> SELECT rowid,* from table WHERE V==0 | V==1;

I'm pretty sure you mean WHERE V=0 or V=1 . You can also write it as WHERE V in 
(0, 1) .  | is a bitwise-OR operator; it just happens to work in your case.

> But additionally, I need to eliminate duplicate (A+B)
> rows.
> My wanted result is:
> ROWID   V       A       B
> ===================
> 1       0       0       1
> 3       0       1       1
> 4       0       1       2
> 5       1       0       2

Any particular reason you are choosing the row with ROWID of 5 and not 2? In 
other words, if you have duplicates, by what principle do you choose which row 
to keep?
-- 
Igor Tandetnik

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

Reply via email to