Wednesday, 15 February 2012

mysql - How to return NULL when result is empty? -


I have a simple query that selects one field and only one row, thus a value.

If there is a result of a query in an empty set, can it be returned in any way? Rather than returning zero rows?

I feel that I need nothing to happen, then there is zero, but not sure about it.

  (your full current selection statement goes here) Select Code> (your full current selection statement goes here) as the alias   

In either case, you are selecting a single value, that means:

  • If your selection returns a value, that value Is returned
  • If your selection details a column, but no row,
  • If you give details of your selection to multiple columns and / or multiple rows, this will not work and the query Fails.

No comments:

Post a Comment