For people with same problem, you do not have to mention the name of the table :
local sql = "select distinct villes.nom\_ville, villes.pays FROM evenements, villes WHERE evenements.id\_ville=villes.code"
for row in db\_now:nrows(sql) do
print( tostring(row.nom\_ville) ) -- this works
end
thanks to myself [import]uid: 5578 topic_id: 24800 reply_id: 100560[/import]
I have a more complex SQL and I need to mention the name of the table because I have 4!
SELECT T2.AREA, T2.PS_POSID1, T2.NAME, T3.PS_POSID2, T3.NAME AS NAME2,T1.TCODE, TT.TTEXT FROM transactions AS T1 INNER JOIN (app01 AS T2, app02 AS T3, transacttext AS TT) ON (T2.PS_POSID1=T1.PS_POSID1 AND T3.PS_POSID2=T1.PS_POSID2 AND TT.TCODE=T1.TCODE) WHERE TT.LANGU = ‘E’ AND T2.LANGU = ‘E’ AND T3.LANGU = ‘E’ AND ( T1.FREQ = ‘A’ OR T1.FREQ = ‘B’ ) ORDER BY T2.AREA, T2.PS_POSID1, T3.PS_POSID2, T1.TCODE
I have a more complex SQL and I need to mention the name of the table because I have 4!
SELECT T2.AREA, T2.PS_POSID1, T2.NAME, T3.PS_POSID2, T3.NAME AS NAME2,T1.TCODE, TT.TTEXT FROM transactions AS T1 INNER JOIN (app01 AS T2, app02 AS T3, transacttext AS TT) ON (T2.PS_POSID1=T1.PS_POSID1 AND T3.PS_POSID2=T1.PS_POSID2 AND TT.TCODE=T1.TCODE) WHERE TT.LANGU = ‘E’ AND T2.LANGU = ‘E’ AND T3.LANGU = ‘E’ AND ( T1.FREQ = ‘A’ OR T1.FREQ = ‘B’ ) ORDER BY T2.AREA, T2.PS_POSID1, T3.PS_POSID2, T1.TCODE