Shashi
Shashi

Reputation: 2185

How to Implement UNION query in symfony Prople

I am using symfony v.1.4.6 (Propel) & php 5.2.6

I got one challanging situation where i have to implement the bellow query into symfony Propel I googled it alot but i failed to find the perfect solution to implement UNION in propel

SELECT top 5000 filetable.sha2, finalhash.ihash FROM filetable (nolock)
JOIN finalhash (nolock) ON (filetable.finalhash_id=finalhash.id)
WHERE (
    finalhash.ihash ='1FDE08EACCC5B247026D1D3A71DDD3846E31095D3A852CCFCDF3B7EAC00FD6D1' 
) 
UNION ALL
SELECT top 5000 filetable.sha2, finalhash.ihash FROM filetable (nolock)
LEFT JOIN finalhash (nolock) ON (filetable.finalhash_id=finalhash.ID)
WHERE (
    filetable.sha2='1FDE08EACCC5B247026D1D3A71DDD3846E31095D3A852CCFCDF3B7EAC00FD6D1'
) 

Please guide me and give suggestion to implement above query in symfony Propel :/

Thanks for all of you!

Upvotes: 1

Views: 1191

Answers (1)

Tomasz Madeyski
Tomasz Madeyski

Reputation: 10900

As far as I know Propel doesn't have support for UNION the way you (and me too) would want. You can do two separate queries in Propel and do union on php side or try to achieve what you want with Criteria.

Check these similar questions:

Upvotes: 2

Related Questions