How can I prepare WITH CLAUSE using Oracle .Net entity framework queries

common-table-expression entity-framework entity-framework-6 oracle

Question

I'm trying to achieve the below query with entity query. How WITH Clause is implemented?

WITH EVENTS AS
(select * from EVENTS_ATCS WHERE ROWNUM <10)
select * from EVENTS A
LEFT JOIN ATCS_EVENT_MASTER B ON
(A.TYPEID = B.EventId)
AND
((A.BYTE1 >= B.GE_BYTE1 AND A.BYTE1 <= B.LE_BYTE1) OR (A.BYTE1 = B.E_BYTE1))
AND
((A.BYTE2 >= B.GE_BYTE2 AND A.BYTE2 <= B.LE_BYTE2) OR (A.BYTE2 = B.E_BYTE2))
AND
((A.BYTE3 >= B.GE_BYTE3 AND A.BYTE3 <= B.LE_BYTE3) OR (A.BYTE3 = B.E_BYTE3))
1
0
9/2/2018 9:40:25 AM

Popular Answer

If I understood the problem, it is that you can't use the WITH factoring clause. If that's so, move the EVENTS CTE into the FROM clause:

select * 
from 
  (select * from EVENTS_ATCS WHERE ROWNUM <10) A           --> this is EVENTS
LEFT JOIN ATCS_EVENT_MASTER B ON (A.TYPEID = B.EventId)
AND ((A.BYTE1 >= B.GE_BYTE1 AND A.BYTE1 <= B.LE_BYTE1) OR (A.BYTE1 = B.E_BYTE1))
AND ((A.BYTE2 >= B.GE_BYTE2 AND A.BYTE2 <= B.LE_BYTE2) OR (A.BYTE2 = B.E_BYTE2))
AND ((A.BYTE3 >= B.GE_BYTE3 AND A.BYTE3 <= B.LE_BYTE3) OR (A.BYTE3 = B.E_BYTE3))
0
9/2/2018 9:45:12 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow