Size: 298
Comment:
|
Size: 627
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
== Dynamic SQL where == | == Dynamic SQL , conditional where == |
Line 10: | Line 10: |
select * from mysql.user where (user=NULL or NULL is null) and (host=NULL or NULL is null) select * from mysql.user where (user='root' or 'root' is null) and (host=NULL or NULL is null) select * from mysql.user where (user='root' or 'root' is null) and (host='127.0.0.1' or '127.0.0.1' is null) |
MySQL
Dynamic SQL , conditional where
SELECT first_name, last_name, subsidiary_id, employee_id FROM employees WHERE ( subsidiary_id = :sub_id OR :sub_id IS NULL ) AND ( employee_id = :emp_id OR :emp_id IS NULL ) AND ( UPPER(last_name) = :name OR :name IS NULL ) select * from mysql.user where (user=NULL or NULL is null) and (host=NULL or NULL is null) select * from mysql.user where (user='root' or 'root' is null) and (host=NULL or NULL is null) select * from mysql.user where (user='root' or 'root' is null) and (host='127.0.0.1' or '127.0.0.1' is null)