1. Helge Tjelta
  2. Valentina Database ADK
  3. Friday, June 05 2015, 10:36 PM
  4.  Subscribe via 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.
Comment
There are no comments made yet.
Ruslan Zasukhin Accepted Answer
Notice: In Valentina 6.0 group by expression works already.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Sergey Pashkov Accepted Answer
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?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
  • Page :
  • 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