How to compare two values with the same field using one query in mysql?

Discussion in 'MySQL' started by computerzworld, May 12, 2008.

  1. #1
    Hello Experts,
    I am having problem in generating query in mysql. I am having two different values which I want to compare in database table's one field and want to retrieve one other field which is static amongst these two values. Lets say I have one field named stationId and I have two stationIds at the same time I want to compare and from that I want to retrieve one trainId which is unique between them if both of the comparison matched. How can I do this? Please help me. Thanks in advance.
     
    computerzworld, May 12, 2008 IP
  2. gauravgrt

    gauravgrt Peon

    Messages:
    2,035
    Likes Received:
    129
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try using "or" or "Xor" operator, this might help.
     
    gauravgrt, May 14, 2008 IP