• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Yes/No SQL Quieries

 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a bit reusty on SQL how to I select just "no" entires in a boolean field? Thanks much.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34074
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter,
Which database supports a boolean field?

I have seen char(1) fields used for booleans, but never a boolean field.
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
Some of my projects using Oracle database.
And we usually use Number(1) as boolean field.
We store that value with '1' for true and '0' for false.
We also retrieve that value, and change into boolean value in the value object.

Correct me if i am wrong
Hope this help
daniel
 
Peter Shipway
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey yo,

Sorry I should have been more clear. Microsoft Access is the only Databasing program that refers to Boolean Fields as Yes/No Fields. What I am asking is how to do Select No fields eg I have tired

SELECT a 0

but it dosent seem to work.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Access' query builder to find out. It comes with a gui tool to create queries, and there is an option to look at the "SQL" it generates (though Access SQL tends to be very different from SQL as all other databases understand it)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic