In a query selection I would like to display the result whether a field satisfies a condition.
Imagine that I have a table called stock
. This table has a column that tells me the number of each item in the stock.
What I would like to do is something like this:
SELECT
stock.name, IF (stock.quantity <20, "Buy urgent", "There is enough")
FROM stock
Is there any function in SQL Server to do that?