Results 1 to 4 of 4

Thread: Help with SQL query...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Uninsured for your health
    Join Date
    Jan 2001
    Location
    Stockton, CA
    Posts
    10,028

    Help with SQL query...

    How can I setup a query to search multiple feilds in a table?

    I have it working with only feild, but I would like it more refined.

    Since it's for a real estate site, I'd like the search perameters to berefined down to the city, number of bedrooms, number of bathrooms and so on...
    Quote Originally Posted by Three Rivers Designs
    America! Love it or give it back!

  2. #2
    SG Enthusiast
    Join Date
    Jan 2001
    Location
    DC
    Posts
    4,717
    depending on the DBMS and interpreter, you may need to use quotes in the query.

    SELECT * FROM tablename
    WHERE field1 = x AND field2 = y AND field3 = z

    Above assumes all data is in one table. You can do the same across multiple tables using a JOIN statement.

    Quote Originally Posted by CiscoKid
    How can I setup a query to search multiple feilds in a table?

    I have it working with only feild, but I would like it more refined.

    Since it's for a real estate site, I'd like the search perameters to berefined down to the city, number of bedrooms, number of bathrooms and so on...
    anything is possible - nothing is free


    Quote Originally Posted by Blisster
    It *would* be brokeback bay if I in fact went and hung out with Skye and co (did I mention he is teh hotness?)

  3. #3
    Uninsured for your health
    Join Date
    Jan 2001
    Location
    Stockton, CA
    Posts
    10,028
    Thanks, I dunno what was wrog...but that's what I had three days ago that didn't work...but now it does...? weird...
    Quote Originally Posted by Three Rivers Designs
    America! Love it or give it back!

  4. #4
    SG Enthusiast
    Join Date
    Jan 2001
    Location
    DC
    Posts
    4,717
    BTW - you get the best performance by using the most discrete field first - the one most likely to be unique.
    anything is possible - nothing is free


    Quote Originally Posted by Blisster
    It *would* be brokeback bay if I in fact went and hung out with Skye and co (did I mention he is teh hotness?)

Similar Threads

  1. mysql query help
    By TonyT in forum Programming Forum
    Replies: 3
    Last Post: 07-20-05, 07:33 PM
  2. T SQL Question - Cursors vs. Select
    By BumperSticker in forum Programming Forum
    Replies: 5
    Last Post: 07-19-05, 12:46 AM
  3. update query Access
    By lance-tek in forum Programming Forum
    Replies: 5
    Last Post: 11-05-03, 11:35 PM
  4. Access 2002 query problem
    By Jon in forum Programming Forum
    Replies: 1
    Last Post: 05-09-03, 01:18 AM
  5. Replies: 2
    Last Post: 03-08-01, 05:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •