Hello team,
I am trying to run this sql code getting this "not a group by expression " error which is shown in screenshot1.But the executed sql of this code is working fine in oracle database which is shown in the screenshot2.Can anyone please help me in resolving this issue.
Screenshot2
Screenshot1
Hi,
it's clear showing some of attribute you are selecting is not in group by please check it.And the image not showing whole sql statement.
Hello Rahul,
kindly find the below screenshot and the group by is the alias name of the attributes.
In none of your screenprints are you showing the complete sql from beginning to end
Hello Dorine,
I am attaching the complete screenshot of the query here.
Ok,
so I find it hard to believe if you execute the exact full sql generated from this, you would get the result you want from oracle.
first thing I notice (might not be it, but if not, please explain why this works) :
it looks like you are missing 2 closing round brackets at the end of line 22
EDIT : aah no, that's not it, i can now see the 2 brackets earlier on that line.
Sorry if i led you down the wrong path with this comment
Hi Suvetha,
Since an ORA error code is given, you can be certain that the error is coming from the (Oracle) database, and that it's not an OutSystems problem. If you Google on that error, you'll find countless troubleshooting tips and tricks.
Personally I'd break down this monstrosity of a query, and see if each individual part runs as expected, before trying it all together.
Hello Killian,
Thanks for the reply.The query is working fine in oracle database but while we are converting our code as per Outsystems we are getting not a group by error. Please have a look at screenshot2 which is mentioned in the trial comment and please let me know if there are any possibilities to resolve this.
Thanks
If you have access to the Oracle database, you may be able (or ask a DBA) to see the exact query OutSystems is sending to the database, so you can troubleshoot. There is no doubt something amiss with the SQL that causes this error.
Hi @Suvetha Balakrishnan ,
another thing worth exploring as giving the union result an alias.
In an Outsystems setting with SQL Server, it needs an alias, so I don't know if this is also the case for Oracle, but just try and see.
Dorine