Answered step by step
Verified Expert Solution
Question
1 Approved Answer
generate an sql query where we have to check whether the patients are double positive or triple postive based on the safollowing condition: If MYC
generate an sql query where we have to check whether the patients are double positive or triple postive based on the safollowing condition:
If MYC positive, BCL positive then double positive
If MYC positive, BCL positive then double positive
If MYC positive, BCL positive and BCL positive, then triple positive.
There are three columns to check it MYC BCLBCL which have corresponding values metioned in the above condition in their respective columns.
I have created a query as follows :
SELECT
CASE
WHEN "COUNTDISTINCTMYC AND "COUNTDISTINCTBCL THEN 'Double Hit'
WHEN "COUNTDISTINCTMYC AND "COUNTDISTINCTBCL THEN 'Double Hit'
WHEN "COUNTDISTINCTMYC AND "COUNTDISTINCTBCL AND "COUNTDISTINCTBCL THEN 'Triple Hit'
ELSE 'None'
END AS HitStatus
FROM #table# AS "table";
but the output is returning the value double positive even if all the three columns contain the corresponding columns.
eg MYC is postive, BCL is positive, BCL is positive still returns double positive instead of triple positive.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started