SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Query help

  1. #1
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Query help

    Why doesn't this query work

    SELECT *
    FROM `all-data`
    WHERE sea = '2010'
    AND ht = 'A' OR at = 'A'

    The problem is that the where sea ='2010' doesn't seem to work. If I remove the where clause the query works if i remove the and section the query works but when they are both put together it fails and doesn't recognise the 2010 aspect of the query.

  2. #2
    SitePoint Wizard tgavin's Avatar
    Join Date
    Feb 2003
    Location
    FL
    Posts
    1,051
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this

    SELECT *
    FROM `all-data`
    WHERE sea = '2010'
    AND (ht = 'A' OR at = 'A')

  3. #3
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    excellent thank you


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
  •