Click here to Skip to main content
15,889,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
Select *
From
(
Select new_do_presentation,COUNT(new_do_presentation) as presentation
from FilteredNew_dineintakeawaycommentcard
where createdon > '7/25/2011'
and createdon <'7/27/2011'
Group by new_do_presentation


UNION

Select new_do_temperature,COUNT(new_do_temperature) as temperature
from FilteredNew_dineintakeawaycommentcard
where createdon > '7/25/2011'
and createdon <'7/27/2011'
Group by new_do_temperature

UNION

Select new_do_taste,COUNT(new_do_taste) as taste
from FilteredNew_dineintakeawaycommentcard
where createdon > '7/25/2011'
and createdon <'7/27/2011'
Group by new_do_taste
)AS tab
Group by new_do_taste, new_do_temperature,new_do_presentation;




The real Problem is that this query make select with repetition(Even I use Group By)(every task Work normaly when i selected in the same table make this problem)


What i need is to select 3 columns from X tables (this columns contain YES Or No values)then i need to see each columns how many times contain yes and no
Posted
Updated 27-Jul-11 3:56am
v4
Comments
DominicZA 27-Jul-11 8:51am    
Is it breaking, what is it doing? Be more specific!!
OriginalGriff 27-Jul-11 8:52am    
When you say "Doesn't work" what do you mean? It is unemployed? Blue screens the PC? Or just returns unexpected results?
_Zorro_ 27-Jul-11 8:54am    
It's like going back to school again... no error provided, nothing...
Christian Graus 27-Jul-11 10:01am    
But you don't even check if it's yes or no, as it stands ?

1 solution

You don't say what 'does not work' means, but take each subquery and confirm if it gives you what you expect, then, when you know what works and what doesn't, explain to us what the issue is if you want help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900