I am looking for a way to get a request like:
Mysql:
Example: IF SELECT COUNT(column_XX) WHERE column_XX = value_XX FROM table_XXmore than zero ( 0), and then SELECTeverything or SELECT * FROM, which table_XX WHERE column_XX = value_XXreturns all the data ... else return "nothing was found" or just ZERO ( 0)
In simple words, I want to select all the data from the column of the table if all the values in the column are greater than zero, otherwise we will select only the values> = 1 and return all the values.
What magic can I use here to do this in SINGLE QUERY ? ... I'm really thankful.
source
share