Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3180

Logic Missing on Query

$
0
0

hello experts

 

Missing Some Logic ,Please Correct it , But Query executing and Gives Wrong Out put

 

SELECT  T1.[U_code], T1.[U_name],  T2.[Salary] "CTCNov",

(Select a.[Salary]

FROM [dbo].[@PR_SAL]  T0 Inner Join  [dbo].[@PR_SAL1]  T1 ON T1.[DocEntry] = T0.[DocEntry] inner join

OHEM a  ON  T2.[empid] = T1.[U_code] inner join OUBR T3 ON T2.branch = T3.Code INNER JOIN OUDP T4

ON a.dept = T4.Code

WHERE   

T0.[U_Year] ='2015' and  T0.[U_Month] = 'Dec' and

a.[empID] = T1.[U_code])as April

 

FROM [dbo].[@PR_SAL]  T0 , [dbo].[@PR_SAL1]  T1,

OHEM T2 INNER JOIN OUBR T3 ON T2.branch = T3.Code INNER JOIN OUDP T4

ON T2.dept = T4.Code

WHERE

T1.[DocEntry] = T0.[DocEntry] and T2.[empid] = T1.[U_code] and 

T0.[U_Year] ='2015' and  T0.[U_Month] = 'Nov' and

T2.[empID] = T1.[U_code]

 

--Ramudu


Viewing all articles
Browse latest Browse all 3180

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>