Answered step by step
Verified Expert Solution
Link Copied!

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, BCL2 positive then double positive
If MYC positive, BCL6 positive then double positive
If MYC positive, BCL2 positive and BCL6 positive, then triple positive.
There are three columns to check it MYC, BCL2,BCL6 which have corresponding values metioned in the above condition in their respective columns.
I have created a query as follows :
SELECT *,
CASE
WHEN "COUNT_DISTINCT(MYC)"=1 AND "COUNT_DISTINCT(BCL2)"=1 THEN 'Double Hit'
WHEN "COUNT_DISTINCT(MYC)"=1 AND "COUNT_DISTINCT(BCL6)"=1 THEN 'Double Hit'
WHEN "COUNT_DISTINCT(MYC)"=1 AND "COUNT_DISTINCT(BCL2)"=1 AND "COUNT_DISTINCT(BCL6)"=1 THEN 'Triple Hit'
ELSE 'None'
END AS Hit_Status
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, BCL2 is positive, BCL6 is positive still returns double positive instead of triple positive.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

What are the advantages and disadvantages of buying a franchise?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago