[SOLVED] how to use groupby with 2 tables
i have sql query..it is havin gtwo tables with a groupby ..i seems it is not working in derby
the query is
SELECT MarkInfo.RegNumber as REGISTER_NUMBER, Name as NAME ,sum(Internal +Extern) AS TOTAL,avg(Internal + Extern)AS AVERAGE
where StudentInfo.RegNumber = MarkInfo.RegNumber
group by MarkInfo.RegNumber
when i executed this i got error like
Error code -1, SQL state 42Y30: The SELECT list of a grouped query contains at least one invalid expression. If a SELECT list has a GROUP BY, the list may only contain valid grouping expressions and valid aggregate expressions.
how can i execute that in derby
any alternative ..