4
Good is possible together the year and the month, and spend a party like this 20017-06
for the select?
SELECT SUM(valor) FROM contas where YEAR(data) = '2017' and MONTH(data) = '06'
4
Good is possible together the year and the month, and spend a party like this 20017-06
for the select?
SELECT SUM(valor) FROM contas where YEAR(data) = '2017' and MONTH(data) = '06'
3
Yes it is possible, use the function date_format()
passing the desired format in place of the two functions. Y
for the 4-digit year and m
for the month with two digits.
SELECT SUM(valor) FROM contas where date_format(data, '%Y-%m') = '2017-07'
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.
Perfect, that’s exactly what I needed here. Vlw brother.
– Leandro
opa, vlw. this will help a lot.
– Hugo Borges