problem in select query
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: problem in select query

  1. #1
    Join Date
    Jan 2003
    Posts
    141

    problem in select query

    Hi,
    When i selected this table i got the following output...

    SQL> select ch_crim_function_id from gc_criteria_m WHERE ch_crim_function_id='TFID';

    CH_CRIM_
    --------
    TFID
    TFID
    TFID
    TFID

    SQL> select ch_crim_function_id from gc_criteria_m WHERE ch_crim_function_id='TFID ';

    CH_CRIM_
    --------
    TFID
    TFID
    TFID
    TFID

    SQL> select ch_crim_function_id from gc_criteria_m WHERE ch_crim_function_id='TFID ';

    CH_CRIM_
    --------
    TFID
    TFID
    TFID
    TFID

    SQL> DESC gc_criteria_m
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    CH_CRIM_COUNTRY_CODE NOT NULL CHAR(2)
    CH_CRIM_FUNCTION_ID NOT NULL CHAR(8)



    Thnaks,

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    Where is the problem ??
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Jan 2003
    Posts
    141
    sorry!When i pasted the query with space, the spaces are not getting displayed in the forum.

    both the queries give the same output?


    WHERE ch_crim_function_id='TFID';

    CH_CRIM_
    --------
    TFID
    TFID
    TFID
    TFID

    WHERE ch_crim_function_id='TFID-------------';/

    CH_CRIM_
    --------
    TFID
    TFID
    TFID
    TFID
    (to represent blank space after TFID i hav given --------)
    the value in the where class with space 'TFID--------' gives the same value as 'TFID'
    Last edited by castlerock; 06-27-2003 at 03:00 AM.

  4. #4
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    I still dont see any problem here.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  5. #5
    Join Date
    Dec 2001
    Posts
    141
    It is because the datatype of the ch_crim_function_id column is CHAR(8).
    For every row, the column is filled with space to reach the 8 caracters size.
    So, it is impossible that the column contains 'TFID' exactly.
    A implicit conversion was made ...
    Hope this help.

Posting Permissions

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



Click Here to Expand Forum to Full Width