Hi guys,
I have this Select:
SELECT "field_1", "field_2","field_3", MIN(COALESCE(NULLIF("field_4",'') ,'TBD')) MINDP,MIN("field_5") MINBOD FROM "MY_TABLE" GROUP BY "field_1", "field_2","field_3"
And when I try to use:
import net.java.ao.Query; public List<myClass> find() { String SQL = "SELECT \"field_1\", \"field_2\",\"field_3\", MIN(COALESCE(NULLIF(\"field_4\",'') ,'TBD')) MINDP,MIN(\"field_5\") MINBOD FROM \"MY_TABLE\" GROUP BY \"field_1\", \"field_2\",\"field_3\"" return newArrayList(ao.find(myClass.class, Query.select(SQL))); }
My code bring all issues in table (does not execute select).
But when I run this query in postgreSQL console, It works
Any suggestions?
Thanks
Community moderators have prevented the ability to post new answers.
Actually I changed my code to: return newArrayList(ao.findWithSQL(myClass.class, "ANY_INT_column_inRESULT",SQL)); and it worked :) but I still want to know why this is not working
Again, this is a SQL question, not an Atlassian one. I'd ask it in a postgresql forum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok yeah you are right! just commenting for somebody with same problem. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd suggest asking in a Java/SQL forum - it might be running in JIRA, but you're not asking about JIRA really, it's a SQL and Java question that has nothing to do with JIRA (in fact, any recommendation about JIRA and SQL is "don't use SQL against a JIRA database, do it properly and use the API. And JIRA is broadly database agnostic too)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.