can sql yoga perform a union and/or intersect query

This is the place to post technical queries about SQL Yoga

Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

can sql yoga perform a union and/or intersect query

Post by trevordevore » Fri Oct 11, 2013 1:55 pm

[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)

)
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

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

Post by trevordevore » Fri Oct 11, 2013 1:55 pm

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.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “SQL Yoga”