7 Replies Latest reply on Apr 8, 2016 10:41 PM by Santhosh Thadakamalla

    Custom SQL - Order by <parameter selection> desc

    Santhosh Thadakamalla

      Hi,

       

      Please help me to resolve my issue. I would like to apply "order by <parameter selection>" in the custom SQL. Let me know if this is possible or any workarounds?

       

      Actual SQL:

      SELECT user_id as "Top 10 Visitors", SUM(page_views), SUM(Visits) FROM web_stats

      GROUP BY user_id

      ORDER BY SUM(page_views) DESC LIMIT 10

       

      PARAMETER selection:

      SELECT user_id as "Top 10 Visitors", SUM(page_views), SUM(Visits) FROM web_stats

      GROUP BY user_id

      ORDER BY <PARAMETER> DESC LIMIT 10