I have a huge table with several columns. Each element in column_H is a little matrix 2x4, with booleans.
I need to SELECT the rows WHERE the 8 boolean elements in column_H, per row, are False.
Is it possible? How? (I am employing a Python wrapper to SQL)
Well, if your database supports booleans, then you would just do:
select t.*
from t
where not bool1 and not bool2 and not bool3 and not bool4 and
not bool5 and not bool6 and not bool7 and not bool8;
If your values are bit-encoded, then they are not "boolean"s. It might work to compare:
where column_h = 0
Each element in col_H is a matrix, so I don't have direct access to each boolean but only to the matrix.
Since I am employing a Python wrapper to SQL, I just figured I could try to mix both languages :-S
And now I managed to make it work! My actual code is:
select *
from table
where col_H[0,0] == False
&& col_H[0,1] == False
&& col_H[1,0] == False
&& col_H[1,1] == False
&& col_H[2,0] == False
&& col_H[2,1] == False
&& col_H[3,0] == False
&& col_H[3,1] == False
;
It works perfectly.
Thanks!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.