I can write the following sqlite query, how can I use sequel to do the
same thing?  What stumps me is the CASE statement in the ORDER BY
clause.  I am trying to get a list of people in this group and have
supervisor/manager listed first, then order by last name, first name
ignoring case.




SELECT
  A.login,
  A.f_name,
  A.l_name,
  A.type,
  V.name AS vendor,
  A.lastlogin
FROM
  accounts A
  LEFT OUTER JOIN vendors V
    ON ( A.vendor_id = V.id )
WHERE
  A.`group` = 'SBC'
ORDER BY
  CASE WHEN A.type = 'supervisor' or
            A.type = 'manager'
        THEN 1
  ELSE 2
  END,
  A.l_name COLLATE NOCASE,
  A.f_name COLLATE NOCASE;

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to