Skip to content
Advertisement

SQL query to count rows based on condition? Keep getting syntax error for my count logic

So I want my query to return how many books total as a column, but how many books are returned as a column. I’m using count also applying a condition, but I’m getting error saying:

Incorrect syntax near ‘)’.

Anyway to achieve this?

Advertisement

Answer

Here is the syntax error count(bookstatus = R)

You can convert it like below

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement