Skip to content
Advertisement

Tag: count

SQL – count function not working correctly

I’m trying to count the blood type for each blood bank I’m using oracle DB the blood bank table is created like this when I use the count function the result would be like this so why the count function is not working correctly? I’m trying to display each blood bank blood type count which is not only one in

2 column with 2 different condition in one table

is it possible to create a query that will output 2 column with 2 different WHERE clause this my ideal output: where count 1 is the result of the 1st WHERE clause. Which I already created. What I want is to have another column where in the value will be with different WHERE clause. here’s my query: with this query

how to query the max value of count

I try to get the max count value but error this is my data I need to get the max count of tool_id I use this code to get tool_count and I use to get max tool_count but it error the result I need : Answer You can try using order by desc with limit 1

count() results without using group by

I am attempting something very similar to last example (Using GROUP BY) on this page: https://thecodedeveloper.com/mysql-count-function/ Referring to the following table of data: The following query: Will produce the following output: Except I want to see the number of employees in each department as well as every user in the table. So I want the output to look like this:

Advertisement