Re: group by hour + distinct
От | Oliveiros d'Azevedo Cristina |
---|---|
Тема | Re: group by hour + distinct |
Дата | |
Msg-id | D352FB1B6AD34FC1A0E5052DB2A786A5@marktestcr.marktest.pt обсуждение исходный текст |
Ответ на | group by hour + distinct (Michele Petrazzo - Unipex <michele.petrazzo@unipex.it>) |
Список | pgsql-sql |
> > Ciao > * Olá! >> for each hour it will count the number of distinct user_id's there >> are . If I understood correctly what you need... >> >> Can you please test it and see if it is OK for your needs? With me, >> it worked on the sample data you provided >> > > Yes! Simply perfect! > * Great to hear it worked ! >> > > Thanks, > Michele * Don't mention it ;-) > > P.s. Have you some references about the "subquery" keyword? I found only > the word subquery as "use" (for example: select a from b where id in > (select id from table)), but not as sql command. > > * I don't know subquery as an SQL keyword too. In the query I gave you the "subquery" thing was just an alias. Such kind of things are mandatory. If I try to omit it, I get this error ERROR: subquery in FROM must have an alias HINT: For example, FROM (SELECT ...) [AS] foo. ********** Erro ********** ERROR: subquery in FROM must have an alias Estado de SQL:42601 Sugestão:For example, FROM (SELECT ...) [AS] foo. So, even though the "subquery" alias was not used anywhere else, I believe it had to be there, otherwise the SQL parser would complain Best, Oliver
В списке pgsql-sql по дате отправления: