tags:

views:

121

answers:

1

In MSSQL, when I want to ignore an empty filter parameter, I do the following

SELECT * FROM Table WHERE EmployeeName = ISNULL(@EmployeeName, EmployeeName);

How would I achieve this in MySQL?

+1  A: 

use coalesce() instead.

longneck
Thanks, but it looks like I'm going to have to use dynamic SQL instead of procs, to allow for dynamic ordering, unless you could kindly suggest a way of achieving that in a mySQL stored proc.
ProfK