Subquery Question
Thank youRegards Palle Technologies < a href="http://www.techpalle.com" >
View ArticleSubquery Question
If you insist, this one does not use INNER JOIN:;with cte as (select s.rID, (select count(P.PID) from @Patients P where P.SID = S.SiD) as [Total Patients] from @States S ) select R.* from @Regions R...
View ArticleSubquery Question
Can you give me the query without using joins any where in the queryRegards Palle Technologies < a href="http://www.techpalle.com" >
View ArticleSubquery Question
Try:DECLARE @Patients TABLE ( PID INT, PNAME CHAR(1), SID INT ) INSERT INTO @Patients SELECT 1,'a',1 UNION ALL SELECT 2,'b',1 UNION ALL SELECT 3,'c',2 UNION ALL SELECT 4,'d',5 UNION ALL SELECT 5,'e',5...
View ArticleSubquery Question
The reason was i am just practicing the subquery . I just wanted to see the out put by using subquery and Shkumar answers is not giving proper output. because total patients from south is 5 & from...
View ArticleSubquery Question
Thank you for your reply but i wanted to get the result only by using sub query.This statement to me sounds self-inconsistent or is perhaps newbie flavored; do you mean you want to get the results...
View ArticleSubquery Question
Thank you for your reply but i wanted to get the result only by using sub query.Regards Palle Technologies < a href="http://www.techpalle.com" >
View ArticleSubquery Question
DECLARE @P TABLE ( PID INT, PNAME CHAR(1), SID INT ) INSERT INTO @P SELECT 1,'a',1 UNION ALL SELECT 2,'b',1 UNION ALL SELECT 3,'c',2 UNION ALL SELECT 4,'d',5 UNION ALL SELECT 5,'e',5 UNION ALL SELECT...
View ArticleSubquery Question
The best option would be to use join...select r.name,count(*) from regions r join states on r.rid = s.ridjoin patients p on p.sid = s.sidgroup by r.nameorder by count(*) DESCNot tested...Murali Krishnan
View ArticleSubquery Question
Hello,Subqueries are not necessary, a simple join + count will work to:SELECT TOP 1 R.rname ,COUNT(*) AS CntPat FROM regions AS R INNER JOIN states AS S ON R.rid = S.rid INNER JOIN patients AS P ON...
View ArticleSubquery Question
not tested but may this work :select rid,MAX(total) from ( select pid,pname,r.rid,COUNT(*) as total from patients p inner join states s ON p.sid = s.sid INNER JOIN regions r ON r.rid = s.rid group by...
View ArticleSubquery Question
How to find Region from which maximum patients are registered with respect to the given tables using sub query.Regards Palle Technologies < a href="http://www.techpalle.com" >
View Article
More Pages to Explore .....