mysql if exists return the record value instead of regular output
I want a select that if/exists it returns the ‘link’ value instead of regular output. so instead of ‘1’ it returns the ‘link’ Is that possible? SELECT IF( EXISTS( SELECT link FROM modules WHERE module=’license’ ), 1, ‘/dashboard/’ ) >Solution : Use aggregation with MAX() (or MIN()): SELECT COALESCE(MAX(link), ‘/dashboard/’) link FROM modules WHERE module… Read More mysql if exists return the record value instead of regular output