Ask Your Question
0

What is the method to obtain a count from specific columns while disregarding the rest?

asked 2021-08-06 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-10-08 09:00:00 +0000

djk gravatar image

To obtain a count from specific columns while disregarding the rest, you can use the SELECT statement to specify the columns you want to include in the count, and then use the COUNT() function to count the number of rows that meet your criteria. For example:

SELECT COUNT(column1), COUNT(column2) FROM table_name;

This will return a count of the number of rows in the table where the values in column1 and column2 are not null. Any other columns in the table will be ignored.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-08-06 11:00:00 +0000

Seen: 13 times

Last updated: Oct 08 '21