Hi,
as I'm currently refactoring some of my complex jdbc prepared
statements to a more generic ORM approach, using pure Sequel, I found
it very difficult to translate such SQL query:
SELECT NAME, COUNT(REV)=0 AS LEAF FROM PROD
I cannot pass the stage beyond count. So far, I'm stuck now with:
DB[:prod].select{[:name,count(:rev).as(:leaf)]}.sql
=> "SELECT NAME, count(REV) AS LEAF FROM PROD"
I could not find how to code the boolean test (equal to 0). Can
someone with experience on using count+test+aliasing help me?
Thanks in advance.
--
Christian
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.