![]() |
a little help with a mysql query, please.
Is it possible to count the total number of fields in a table that are empty? If so, please let me know, I cant find anything in the manual.
|
yes.
select count(*) from table_name where field1 isNULL and field2 isNULL and ...; or if the fields are empty as in (they were set empty by code): select count(*) from table_name where field1 = '' and field2 = '' and ...; i don't know of any built-in mysql function that will help, due to the fact of varying structure of tables. peace |
ooops, nevermind.
that just returns the number of records with "empty" fields.. not what you wanted. :) |
Quote:
|
ah, yeah I just noticed that now. It actually is what I need, but this couints tyhe entire database, enstead of a specific column. I need the blank fields in USERS where id=x
|
All times are GMT -7. The time now is 09:14 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123