1. Helge Tjelta
  2. Valentina Database ADK
  3. Пятница, Июнь 05 2015, 10:36 PM
  4.  Подписаться через email
Hi, a simple group by question.

How to I get a table to group by month when having a dato field...

SELECT COUNT(*), month(dato) AS MND
FROM SALG
GROUP BY month(dato)

will not work because I'm not allowed to use expressions in group by...

Other SQL can, not Valentina... why or what is the workaraound...

Please help...

I also need to get week number of year grouping as well.
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
Notice: In Valentina 6.0 group by expression works already.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hi, Helge

Here's how it can be done:

SELECT COUNT(*), MND
FROM ( SELECT month( dato ) AS MND FROM SALG )
GROUP BY MND

As for the second question, can you add details or a small example, please?
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories