Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 02 Sep 2009 @ 19:03:21 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Subqueries Workaround
 
From:   Anomy Anom

<-- Anonymously Posted: Wednesday, September 02, 2009 13:20 -->

     SELECT  PATIENT_NAME,
     PATIENT_AGE,
     PATIENT_WEIGHT,
     SUM(CASE WHEN DRUG_NAME ='WARFARIN' THEN 1 ELSE 0 END) AS COUNTWARFARIN,
     SUM(CASE WHEN DRUG_NAME ='HEPRIN' THEN 1 ELSE 0 END) AS COUNTHEPRIN
     FROM DRUG_TAKEN
     WHERE PATIENT_ID=10
     GROUP BY 1,2,3;


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023