File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Yes/No SQL Quieries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Yes/No SQL Quieries" Watch "Yes/No SQL Quieries" New topic

Yes/No SQL Quieries

Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
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

Joined: May 26, 2003
Posts: 31571

Which database supports a boolean field?

I have seen char(1) fields used for booleans, but never a boolean field.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
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
Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71
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


but it dosent seem to work.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

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)

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Yes/No SQL Quieries