mysql - Is it possible to SELECT either 1 or 2 columns? -


I am thinking that within MySQL (without PHP), you can make a condition that if true SELECT 1,2 but if false then select 1? Or something similar to MySQL syntax, which can accomplish the same effect?

Thank you.

There is no way to select at least one fixed number column of a stored procedure. The number of columns obtained from the selection statement of any one is constant. The best thing you can do is two case statements, one that will return the null in some circumstances, there are still two columns, but depending on your condition one will be extremely essential.

Comments

Popular posts from this blog

mysql - where clause in inner join query -

java - Why my included JSP file won't get processed correctly? -

php - MySQL Query for Advanced Search multiple criteria -