-1
I need to make a query in a table called controls:
I have the spine CH
which is the workload in minutes and I have the column SETOR
which are the sectors that have participated in some training.
I need to make a query where brings me the total (sum) of minutes per sector. Sector 7 would be for example 1080
the result.
I did so: SELECT round(SUM(ch)) FROM controles WHERE setor = '7';
but it brings me no result.
What kind of your field
setor
?– Matheus Ribeiro
First you have to separate the values of the sector in order to become independent. That is, where it is possible to do a search for ','. For example, the array looks like this: 2,3,4,5. Then I think it will be the "LIKE" and not the = to be used... may be little help, but help in thinking...
– White