Join

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:

Join

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

[This post is an archive from the old SQL Yoga forums]

Hi,

I can't execute this SQL:

Code: Select all

select CLI_ID,CLI_Nombre,CLI_Direccion,CLI_CP,CLI_Poblacion,COMUNICACION.DESCRIPCION,COMUNICACION.VALOR from clientes left join COMUNICACION on (clientes.CLI_ID=COMUNICACION.ID_CUSTOMER and COMUNICACION.TIPO=1)
In Rev:

Code: Select all

put sqlquery_createobject("clientes") into theQueryA

sqlquery_set theQueryA, "select clause","select CLI_ID,CLI_Nombre,CLI_Direccion,CLI_CP,CLI_Poblacion,COMUNICACION.DESCRIPCION,COMUNICACION.VALOR"

sqlquery_set theQueryA, "joins","clientes left join COMUNICACION on (clientes.CLI_ID=COMUNICACION.ID_CUSTOMER and COMUNICACION.TIPO=1)"

sqlquery_set theQueryA, "order by", "clientes.CLI_Nombre"
What is wrong?

Salut,

Josep
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: Join

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

Are you trying to recreate the SQL statement you wrote out using a Query object or the SQL you entered above the query that is returned by sqlquery_get(theQueryA, "query")?

If you are trying to recreate the query and haven't checked the value of sqlquery_get(theQueryA, "query") yet then let's start there.
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”