Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

help with query - inner join and case

$
0
0

Hi this is the query I am having troble with, where is the correct place to add the case condition:

SELECT
*
FROM
END_USER_ORDERS EO
INNER JOIN ORDER_PRODUCTS OP
ON EO.EUO_ID = OP.EUO_ID
INNER JOIN PRODUCTS P 
ON OP.PRD_ID = P.PRD_ID
CASE P.PRD_ID -- PROBLEM IS HERE
		WHEN 'Online' Then 'Public'
	END


INNER JOIN PRODUCT_VERSIONS PV
ON P.PRD_ID = PV.PRD_ID
AND PV.SIT_ID = 'DEFAULT'
AND PV.LOC_ID = 'UK'
LEFT OUTER JOIN ORDER_SESSIONS OS
ON OP.EUO_ID = OS.EUO_ID
AND OP.ORP_SEQ_NO = OS.ORP_SEQ_NO
LEFT OUTER JOIN SESSIONS S
ON OS.SES_ID = S.SES_ID
LEFT OUTER JOIN SUBJECTS SU
ON S.SUB_ID = SU.SUB_ID
WHERE EO.EUO_ID = 'bef8cd51-b398-4521-9350-f3a7c3885c59'


select * from END_USER_ORDERS
order by EUO_DATE desc

Many thanks


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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