How do I generate the WHERE
clause for this query using SQL::Abstract:
SELECT COUNT(*) FROM table WHERE id = 111 AND NOT FIND_IN_SET(type, '1,2,3,4') AND status = 'pending';
What's the proper way to include conditions like WHERE FIND_IN_SET(type, '1,2,3,4')
?
See the not_bool unary operator option:
This is how
$query
looks:This code generates the
WHERE
clause:Take a look at: DALMP
http://code.google.com/p/dalmp/
FIND_IN_SET isn't standard SQL, so SQL::Abstract doesn't have support for it. You can however put any literal SQL into an SQL::Abstract query. I expect your solution lies down that route.