Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with. 
    
        
            
                
                    
                        
                            
                                | Author | 
                                
                                 Topic  | 
                             
                            
                                    | 
                                         GirishKumarSharma 
                                        Starting Member 
                                         
                                        
                                        10 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2013-07-17 : 09:14:39
                                            
  | 
                                             
                                            
                                            | Hi,I know, it is bad etiquette to post the same question link in other forum, but here it is my question link :http://www.sqlservercentral.com/Forums/Topic1474579-8-1.aspxI am sorry, to post the question in such a way, but if anyone can please help me by looking the above link, I shall be thankful for your help.Just because I think in that forum, there is less activity, so I am trying here.Thanks and RegardsGirish Sharma | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     visakh16 
                                    Very Important crosS Applying yaK Herder 
                                     
                                    
                                    52326 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2013-07-17 : 11:31:03
                                          
  | 
                                         
                                        
                                          | [code]SELECT code,MAX(CASE WHEN department = 'AKD' THEN netqty END) AS NetQty_AKD,MAX(CASE WHEN department = 'AKD' THEN netmrp END) AS NetMrp_AKD,MAX(CASE WHEN department = 'MRI' THEN netqty END) AS NetQty_MRI,MAX(CASE WHEN department = 'MRI' THEN netmrp END) AS NetMrp_MRI,MAX(CASE WHEN department = 'PHYSIOTHERAPY' THEN netqty END) AS NetQty_PHYSIOTERAPY,MAX(CASE WHEN department = 'PHYSIOTHERAPY' THEN netmrp END) AS NetMrp_PHYSIOTERAPY,MAX(CASE WHEN department = 'SONO' THEN netqty END) AS NetQty_SONO,MAX(CASE WHEN department = 'SONO' THEN netmrp END) AS NetMrp_SONOFROM consumptionGROUP BY code[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     madhivanan 
                                    Premature Yak Congratulator 
                                     
                                    
                                    22864 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |   
     
     
            
              
	     |  
		
			
     
          
		 |