db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Tsui" <chris.kyt...@gmail.com>
Subject Problem using group by order by in Derby 10.2.2.0
Date Thu, 21 Jun 2007 02:12:04 GMT
Dear Sir,

I have created a table with following schema:

CREATE TABLE logging (
  id bigint NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  nodeid bigint,
  actor varchar(256) NOT NULL,
  eventtime timestamp  default current_timestamp,
  action varchar(256) NOT NULL,
  objectname varchar(256) NOT NULL
);


When I executing query like

select max(eventtime) from logging where id > 10  group by action order by
eventtime desc ;

It returns
ERROR 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.

But it works without order by
select max(eventtime) from logging where id > 10  group by action;

I am using embedded mode

Thank you very much

Regards
Chris

Mime
View raw message