6 Replies Latest reply on Aug 7, 2014 8:18 PM by Hudi

    sql 'GROUP BY'

    Hudi

      I'm trying to query a list of transactions pulled from cdBaby.com which will hopefully result in a top 10 list of tracks sold. As it so happens, this query is returning a ?. I've tried many different variations of this query and the GROUP BY and ORDER BY seem to be the issue (wrong order, or perhaps I cannot ORDER BY a Sum. )

       

      Any direction is very much appreciated.

       

      Thanks

       

       

      LeftValues (

       

       

      ExecuteSQL (

      "SELECT isrc, price_total__cn FROM CD_Baby

      WHERE date_of_transaction__cd > ?

      AND

      isrc IS NOT NULL

      Group BY iSRC

      ORDER by Sum ( price_total__cn ) desc

       

      " ; ""; "" ; Date ( 1; 1 ; INTERFACE::current_year__cn )

      )

       

      ;10 )