How to SELECT DEFAULT value of a field

"SELECT $group FROM grouptable WHERE $group=DEFAULT( $group ) "

Or I think better:

"SELECT DEFAULT( $group ) FROM grouptable LIMIT 1 "

Update – correction

As @Jeff Caron pointed, the above will only work if there is at least 1 row in grouptable. If you want the result even if the grouptable has no rows, you can use this:

"SELECT DEFAULT( $group ) 
 FROM (SELECT 1) AS dummy
   LEFT JOIN grouptable 
     ON True
 LIMIT 1 ;"

Leave a Comment