<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: sorting results of a Custom SQL report (Thread)</title><description> Hello,  Im trying to re-sort the results that I get from the SQL query.  My query joins Test Cases with Test Steps and Requirements. It seems to be sorting using record IDs by default.  However, my Test Steps are out-of-sequence, so Test Step 6 has a higher TEST_STEP_ID than Test Step 5 and these show-up in the report in the same default sequence.  I added a new SORTBY column into my SQL hoping that    would work but it doesnt                   Is there another way to custom-sort my results since ORDER BY does not work in ESQL?  Thanks! </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/reports/2104.aspx</link><item><guid isPermaLink="false">threadId=2104</guid><author>Alex Soloviev (alex.soloviev@celerion.com)</author><title>sorting results of a Custom SQL report</title><description> Hello,  Im trying to re-sort the results that I get from the SQL query.  My query joins Test Cases with Test Steps and Requirements. It seems to be sorting using record IDs by default.  However, my Test Steps are out-of-sequence, so Test Step 6 has a higher TEST_STEP_ID than Test Step 5 and these show-up in the report in the same default sequence.  I added a new SORTBY column into my SQL hoping that    would work but it doesnt                   Is there another way to custom-sort my results since ORDER BY does not work in ESQL?  Thanks! </description><pubDate>Mon, 28 Oct 2019 20:14:57 -0400</pubDate><a10:updated>2019-10-29T23:27:19-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2104.aspx</link></item><item><guid isPermaLink="false">messageId=3675</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> You can sort using Entity SQL, however you cannot sort by the ALIAS in the SELECT clause, you have </title><description> You can sort using Entity SQL, however you cannot sort by the ALIAS in the SELECT clause, you have to do it by the actual property names.  I.e. if you have:   select
    (TC.TEST_CASE_ID + TS.POSITION) as SORTBY,   You cannot use:   order by SORTBY   You have to use:   order by (TC.TEST_CASE_ID + TS.POSITION)     </description><pubDate>Tue, 29 Oct 2019 23:27:19 -0400</pubDate><a10:updated>2019-10-29T23:27:19-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2104.aspx#reply3675</link></item></channel></rss>