MySQL Forums
Forum List  »  Newbie

Re: Different Count(distinct) in the same query
Posted by: Rick James
Date: May 12, 2014 11:52AM

4 = COUNT(DISTINCT numcliente)
45 = SUM(nom_bnet_tx)
1380 = SUM(nom_bnet_im)

`NUMCLIENTE` with NOM and with BNE = 2
probably needs a subquery:

2 = ( SELECT COUNT(DISTINCT numcliente) FROM tp_principal_d WHERE bne_m_tx > 0 )

Options: ReplyQuote


Subject
Written By
Posted
Re: Different Count(distinct) in the same query
May 12, 2014 11:52AM


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.