Question
Tristan Meziere · Nov 25

Cache SQL and GROUP BY clause

Hi members,

I have these data :

 

and need to exploit the first character of cot field (Library CDU classification) like this :

 

I get this result... it's approximatively what I want... but I need it in just one line !

With mySQL I get it with just GROUP BY rcddate

In Cache SQL I have to add {fn LEFT(cot,1)} to get the counts of each first character of cot... and seems {fn WEEK(rcddate)} doesn't make the job !

There is a trick ? or I make something wrong ?

kind regards.

Product version: Caché 2018.1
00
1 0 2 37
Log in or sign up to continue

Forget about the week  and put your long query into a subselect

SELECT Sum(Dicos),Sum(Gen),Sum(Philo),Sum(Religion), Sum(SHS), ....
FROM (
.... your long query
)  

Hi,

It's another way ... but it smells the right way ! ;-)

Many thanks