I have a database like this
id, field1,field2,field3,field4,field5
Database contains 100 rows, some rows have no fields filled, some
1field , some 2 fields etc.
How would i count the number of fields filled in total?
So the outcome is (number of fields filled in row1)+(number of fields
filled in row2)+(number of fields filled in
row3)....................+(number of fields filled in row100)
Thanx
Griemer 1 2712
griemer wrote: I have a database like this
id, field1,field2,field3,field4,field5
Database contains 100 rows, some rows have no fields filled, some 1field , some 2 fields etc.
How would i count the number of fields filled in total?
The COUNT() aggregate function ignores NULLs (unless you use COUNT(*)).
I assume that by "filled" you mean non-NULL, while a field not filled
has a NULL state.
SELECT COUNT(field1) + COUNT(field2) + COUNT(field3)
+ COUNT(field4) + COUNT(field5)
FROM myTable
Regards,
Bill K. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gleep |
last post by:
Hey Guys,
I've got a table called Outcomes. With 3 columns and 15 rows
1st col 2nd col 3rdcol
outcome date price
There are 15 rows...
|
by: Hari Om |
last post by:
Here are the details of my error log files:
I execute the command and get following message at console:
----------------------------------------------------------------------
../sqlldr...
|
by: Aaron C |
last post by:
Hi,
I'm trying to do an insert with the following statement:
INSERT INTO user VALUES ( 'ag@ag.com','ag','Aaron','Chandler','','','La
Mirada','CA',90638,714,'','');
and I'm getting the error...
|
by: Megan |
last post by:
Hi everybody-
I'm helping a friend with a music database. She has an old one and is
creating a new one. She wants to compare records and fields in the old
database with records and fields in the...
|
by: cefrancke |
last post by:
I can't seem to find a straight answer for my specific issue.
Any help would be appreciated.
I would like to count the various items in a table where the fields
have a 'group' relationship.
I...
|
by: midnight_use_only |
last post by:
although i don't think this is do-able using SQL, i would ask and maybe
an expert can help me out. assum i have the following table:
Date Code Count
2006-06-06 abc 1234...
|
by: KayC |
last post by:
Hi
I use Access2000 and am trying to count the number of columns in a
table in VBA
Does anyone know if this possible?
thanks
KC
|
by: MP |
last post by:
vb6,ado,mdb,win2k
i pass the sql string to the .Execute method on the open connection to
Table_Name(const) db table
fwiw
(the connection opened via class wrapper:)
msConnString = "Data Source="...
|
by: Marshallp24 |
last post by:
Hi,
I need to be able to display a count of records in a message box but
with a criteria of the just ones where there is a yes in a certain
field. so the message box will pop up saying something...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |