All pastes #536102 Raw Edit

SQL for more than one condition

public sql v1 · immutable
·published 2007-06-04 08:34 UTC
rendered paste body
select * from article where (  IF(author like 'Bob', 1, 0) +  IF(journal like 'MyJournal', 1, 0) +  IF(sciencefield = 'science', 1, 0) +  IF(department like 'Mathematics', 1, 0)) >= 2