How can I create a DAL Select statement from a SQL exists clause?

25 просмотров
Перейти к первому непрочитанному сообщению

George D Elig

не прочитано,
21 апр. 2017 г., 11:17:5121.04.2017
– web2py-users, George D Elig

I have the following SQL statement that I'm having difficulty converting to a db()Select statement. I could use a left join but I can only return one row, which is being addressed with 'limit 1'


select sites.domain_name, batch.batch_name from sites, batch

where exists (select batch.id from batch

              where sites.batchid = batch.id) limit 1


Thanks in advance for any assistance.

D.

Massimo Di Pierro

не прочитано,
26 апр. 2017 г., 21:47:0626.04.2017
– web2py-users, geo...@infotrustllc.com
Unfortunately you will have to use db.executesql for this.
Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений