To reproduce this bug, view a dynamic dataset whose query contains an ORDER BY clause. Click the 'Edit query' button that appears at the top of the screen. Note that the ORDER BY clause doesn't appear on the SQL query page.
I haven't done a systematic check of which types of query don't appear properly, but a couple of examples are given below:
'SELECT m.id, p.title, p.first_name , p.surname , m.verbatim_name , c.club_name , m.joining_date , m.leaving_date FROM club_memberships m JOIN clubs c ON m.club_id = c.id JOIN people p ON m.people_id = p.id ORDER BY "surname" asc'
As noted above, the ORDER BY clause disappears. The query still works, but (obviously) without the ordering.
'SELECT "tblarticles"."title" AS "Title",(EXTRACT (YEAR FROM CURRENT_DATE))-"tblarticles"."year" AS "Years since publication" FROM "tblarticles"'
This one gets considerably more screwed up. The SELECT field is OK, but the FROM field just contains 'CURRENT_DATE))-"tblarticles"."year" AS "Years since publication"' - the table name part gets omitted, and consequently the query doesn't work. (I assume the extra FROM is what's causing confusion here - as in issue #710.)
To reproduce this bug, view a dynamic dataset whose query contains an ORDER BY clause. Click the 'Edit query' button that appears at the top of the screen. Note that the ORDER BY clause doesn't appear on the SQL query page.
I haven't done a systematic check of which types of query don't appear properly, but a couple of examples are given below:
'SELECT m.id, p.title, p.first_name , p.surname , m.verbatim_name , c.club_name , m.joining_date , m.leaving_date FROM club_memberships m JOIN clubs c ON m.club_id = c.id JOIN people p ON m.people_id = p.id ORDER BY "surname" asc'
'SELECT "tblarticles"."title" AS "Title",(EXTRACT (YEAR FROM CURRENT_DATE))-"tblarticles"."year" AS "Years since publication" FROM "tblarticles"'