MySQL detect whether a field is empty or not -
MySQL detect whether a field is empty or not -
i have big database consisting of multiple columns. want select 1 column of little size , check whether column of big size (measured in bytes) null or empty. of course of study select them both , allow server-sided scripting language decide whether sec column empty or not, not need info of sec column, want know if non null , non empty.
now, since i'm not mysql ninja or anything, not sure if there possibility in mysql select "non-emptiness" of column, , if speeds things when handling big columns. inquire because can imagine mysql handles these cases internally differently, since there no need big amounts of disk reading, memory copying, piping server-sided script interpreter, etc. big sec column, when requesting boolean emptiness.
so
is possible select non-emptiness of column and does speed query when column of important size?i not want filter it, rather want column containing entry true/false, depending on whether big column non-empty, every row.
thank much in advance taking effort read , reply this. if has been answered before , failed find answer, please allow me know in comments link , i'll remove question immediately.
you can in sql:
select small_column my_table large_column null or length(large_column) = 0
edit: reply question in comment, can set expressions in select list:
select small_column, (large_column null or length(large_column) = 0) is_large_column_empty my_table
mysql
Comments
Post a Comment