Query Statement


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Query Statement

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    3

    Query Statement

    I want to search for a keyword in all the columns of my database. So please help me for a query to execute like:
    Code:
    statement.executeQuery("select * from BOOKS where Title like '%"+Criteria+"%'");
    Instead of only title i want to search in all the fields.

    If the above is not possible then what is wrong the the following:
    Code:
    statement.executeQuery("select * from BOOKS where Title like '%"+Criteria+"%' Or Author like '%"+Criteria+"%' Or Publisher like '%"+Criteria+"%' Or Type like '%"+Criteria+"%' Or Genre like '%"+Criteria+"%' Or Keywords like '%"+Criteria+"%' Or Comment like '%"+Criteria+"%' Or Category like '%"+Criteria+"%' Or BookSubject like '%"+Criteria+"%' Or Series like '%"+Criteria+"%' Or Illustrator like '%"+Criteria+"%' Or Language like '%"+Criteria+"%' Or Location like '%"+Criteria+"%'");

  2. #2
    Join Date
    May 2005
    Location
    Ontario, Canada
    Posts
    173
    Hello,
    Is this Oracle or Java?
    It looks like Oracle more than Java.

Similar Threads

  1. SQL2000 remote SQL query
    By lightningtechie in forum Database
    Replies: 1
    Last Post: 02-07-2006, 08:34 AM
  2. Query statement assistance
    By fc44 in forum Database
    Replies: 5
    Last Post: 04-21-2005, 04:49 PM
  3. reg....count distinct query
    By Mohan Ekambaram in forum Database
    Replies: 0
    Last Post: 12-08-2001, 11:21 PM
  4. Replies: 1
    Last Post: 01-02-2001, 05:31 PM
  5. IF statement from Access query
    By Eric in forum Database
    Replies: 3
    Last Post: 09-15-2000, 04:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center