MySQL Forums
Forum List  »  PHP

Select COUNT + CURDATE excluding values negatives
Posted by: Fagner fmalmeida
Date: February 12, 2019 02:01PM

Hello guys,

I have the code in my application realizing the SELECT down:

SELECT contrato, data_venc, SUM(IF(DATEDIFF(data_venc, CURDATE()) < 90, 0, 0)) AS data_venc FROM infraestrutura

Result of select:

8
-11
3


But, i need return the values positives of 0 to 90, excluding the values negatives.

Can you help me?

Options: ReplyQuote


Subject
Written By
Posted
Select COUNT + CURDATE excluding values negatives
February 12, 2019 02:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.