sql - SQLite: query excluding rows depending on combinations of values from other columns -
sql - SQLite: query excluding rows depending on combinations of values from other columns -
apologies unclear title, it's kind of hard describe without example. have table can summarized follows:
position_x position_y position_z valuesa valuesb valuesc 10 30 500 value other 5 45 2 value2 other2 another2 45 0 75 value3 other3 another3
i need extract info using specific criteria, have exlcude specific combinations of position_x
, position_y
, position_z
. @ hand have list of combinations want exclude.
when nail row combination of these 3 values, row should excluded query.
so hypothetical query (simplified example)
select valuesa, valuesb, valuesc mytable <other parameters> , ... <condition here>
to refer example, query used exclude rows (10, 30, 500) , (45, 0, 75)?
notice list of values need exclude, on real data, 40 3-value combinations.
is possible?
it possible create virtual table common table expression:
with excluded_positions(position_x, position_y, position_z) ( values (10, 30, 500), (45, 0, 75), ...), excluded_rowids ( select mytable.rowid mytable bring together excluded_positions using (position_x, position_y, position_z)) select valuesa, valuesb, valuesc mytable ... , rowid not in excluded_rowids
sql sqlite sqlite3
Comments
Post a Comment