Forum OpenACS Development: Response to Overview of InterBase's limitations

Collapse
Posted by Sebastian Skracic on
  • ORDER BY expression not supported

    In ORDER BY clause, you can only specify column names which appear in SELECT list or reference them by their position in SELECT list as in

    SELECT user_id, count(*) FROM ratings GROUP BY user_id ORDER BY 2
    

  • GROUP BY expression not supported

    This time, you can't even do "GROUP BY 2" as in ORDER BY clause. So what if you want to GROUP BY pretty_date that is calculated on-the-fly? You must resort to either defining a view (or stored procedure 😊 that will calculate this field and GROUP BY that fieldname, or you can extend the table by creating COMPUTED BY field (InterBase SQL extension):

    ALTER TABLE bboard ADD pretty_date COMPUTED BY (
       EXTRACT (YEAR FROM posting_time) || ' ' ||
          EXTRACT (MONTH FROM postign_time) )
    
    and then GROUP BY pretty_date.