Akhter HUssain

Akhter HUssain

  • 689
  • 1.3k
  • 95.6k

Common table expression defined but not used.

Jun 9 2020 3:08 AM
Getting following error
 
Msg 422, Level 16, State 4, Line 9
Common table expression defined but not used.
 
  1. with vals  
  2. as  
  3. (  
  4. select I_QTY as Iss  From tbl_Issuance where I_Type='Issue'  
  5. union all  
  6. select I_QTY as Ret1  From tbl_Issuance where I_Type='Return'  
  7. )  
  8.   
  9. select Iss - Ret1  as difference  
 
 
 

Answers (6)