Page 1 of 1

can sql yoga perform a union and/or intersect query

Posted: Fri Oct 11, 2013 1:55 pm
by trevordevore
[This post is an archive from old SQL Yoga forums]

I'm doing this with Valentina as the target database, but I don't think there is anything specific about the sql required for an intersect query.

My intersect query is using the same table (with different aliases) to find intersecting records (I know it is probably considered bad design).

Code: Select all

( SELECT a.linked_entity

FROM KEY_VALUE a

WHERE k = 'body' )

INTERSECT

( SELECT b.linked_entity

FROM KEY_VALUE b

WHERE 

(locate('slow', v)>0)

And 

(locate('network',v)>0)

)

Re: can sql yoga perform a union and/or intersect query

Posted: Fri Oct 11, 2013 1:55 pm
by trevordevore
SQL Yoga does not have any built-in support for generating INTERSECT queries. You would need to write the query by hand and then use a handler like dbconn_retrieveQueryAsArray to get the results.