How can I do it ? ( with ORM )

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dangerdodis
    Junior Member
    • May 2018
    • 26

    How can I do it ? ( with ORM )

    Hey there,
    I have not searched and found the forum. I want to write the following code as ORM but I can not find it. I've studied the documentation, but there's nothing like it.
    Please help me.

    Code:
    "SELECT
            COUNT( assigned_status ) AS Count,
            SUM( CASE WHEN m.assigned_status = 'Demo1' THEN 1 ELSE 0 END ) AS Demo1,
            SUM( CASE WHEN m.assigned_status = 'Demo2' THEN 1 ELSE 0 END ) AS Demo2,
            SUM( CASE WHEN m.assigned_status = 'Demo3' THEN 1 ELSE 0 END ) AS Demo3,
            SUM( CASE WHEN m.assigned_status = 'Demo4' THEN 1 ELSE 0 END ) AS Demo4
        FROM
            meeting m
        WHERE
            assigned_user_id = '".$user['id']."'";
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hi,
    it's not possible with ORM, but you can run your query

    I want to get only the WHERE part of the SQL output. Because I will add "where" as to pure php. for example; WHERE assigned_status = 'Okay' like this

    Comment

    Working...