Hi meta-folks,
I'm having a problem when trying to supply some SQL query to MetaModel
(4.5.1).
1) If i use SELECT SUM(total_children) AS total_children_SUM, city AS
city FROM schema.table GROUP BY city I get the right results.
2) If i use (SELECT SUM(total_children) AS total_children_SUM , city AS
city FROM schema.tableGROUP BY city ORDER BY city asc then I get the
right results.
3) But if I use*SELECT SUM(total_children) AS total_children_SUM, city
AS city FROM schema.table GROUP BY city ORDER BY country asc *I wrong
results. I do get results, but these are the same as 1) where no
ordering was required. The same happen with I use any other field that
is not city (which is the field that I'm using for the grouping).
This is how I use it:
/String newSqlQuery =
Query query = dataContext.parseQuery(newSqlQuery);//
//CompiledQuery cQuery = dataContext.compileQuery(query);//
//DataSet dataSet = dataContext.executeQuery(cQuery);/
No error or exception. Just wrong data.
Any ideas?
Many thanks!
Alessandro.