lundi 6 juillet 2015

How to return data using boolean field in Where clause using SQLite

I have a simple table which have the following data

enter image description here
from that table records I simply try to get record where Primary field is set to 1. For that I simply use the following:

select *
from ProductProductPhoto
where ProductId = 12
  and Primary = 1

But I get a synatx error reported by SQLite and have no reason why.

I have also try the querry in following form :

select *
from ProductProductPhoto
where ProductId = 12
  and  Primary

but no luck, the error return in Brwoser for SQlite tool is :

"near "Primary": syntax error: "

Any idea how this syntax need to be ?

Aucun commentaire:

Enregistrer un commentaire