|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
SELECT COUNT() question
I'm trying to count non-blank rows in a table, and everything I've found points to using a
SELECT COUNT(fieldName) FROM databaseName query. Can someone tell me how to return the value I'm looking for (the number of non-blank records for that particular field)? Thanks, --Joe |
|
#2
|
|||
|
|||
|
RE: SELECT COUNT() question
This should work. If you don't allow NULLs replace it with the default value.
|
|
#3
|
||||
|
||||
|
RE: SELECT COUNT() question
SELECT COUNT(fieldName) FROM databaseName WHERE fieldName IS NULL;
and SELECT COUNT(fieldName) FROM databaseName; should return the same number since COUNT() only counts non-NULL values. The reason this might not work for you is that NULL and blank can be different. In that case, change the WHERE cluase to be something like LENGTH(fieldName) > 0 |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > SELECT COUNT() question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|