On Thu, Jan 15, 2015 at 5:31 PM, <[email protected]> wrote:
> I got a problem while run db.select with IN clause
>
> a = ['1','2']
> db.select('books',what="id,bookname",where='id in
> $ids',vars={'ids':[','.join(a)]})
>
> when i run this ,it will convert to SELECT id,bookname FROM books WHERE id
> in* ('1,2') ,* and error with* Truncated incorrect DOUBLE value:
> '1,2' .*
>
> How can I remove the '' ? Is anyone got a solution,many thanks!
>
Here is what you need to do:
a = ['1','2']
db.select('books',what="id,bookname",where='id in $ids',vars={'ids': a})
Anand
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.