Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2013
    Posts
    2

    Unanswered: how where condition works ?

    Table:


    FMT PF .....A..........T.Name++++++RLen++TDpB......Fu
    *************** Beginning of data ************
    0001.00 R REC
    0001.01 ENAME 10A
    0002.00 EID 5A
    0005.00 K EID
    ****************** End of data ***************


    data:


    Position to line . . . . .
    ....+....1....+..
    ENAME EID
    nagendra 1
    venkat 2
    prashanth 3
    MANILA 4
    ABHI 5
    ammulu 9
    kanni 11



    Query:

    select a.eid,b.eid from emp a,emp b where a.eid<b.eid

    Result:

    Position to line . . . .
    ....+....1..
    EID EID
    1 2
    1 3
    1 4
    1 5
    1 9
    1 11
    2 3
    2 4
    2 5
    2 9
    3 4
    3 5
    3 9
    4 5
    4 9
    5 9
    11 2
    11 3
    11 4
    11 5
    11 9
    ******** End of data ********

    i failed to understand how "where" condition works. please explain me about where condition in detail.
    thanks in advance.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i don't understand the format stuff you posted, but the comparison is being done on character strings

    so '1' is less than '11'

    you'll want to do a numeric compare, not a string compare
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2013
    Posts
    2

    Post

    Thanks for your reply. i will do correct.

Posting Permissions

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