File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Yes/No SQL Quieries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Yes/No SQL Quieries" Watch "Yes/No SQL Quieries" New topic
Author

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
Marshal

Joined: May 26, 2003
Posts: 30749
    
156

Peter,
Which database supports a boolean field?

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


[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
daniel
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

SELECT a 0

but it dosent seem to work.
Paul Sturrock
Bartender

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: http://aspose.com/file-tools
 
subject: Yes/No SQL Quieries