I have a record which has value with leading and space in a column.
eg: column value is ' D0019 '
I want to pass this particular column in where clause.
select * from my_table where my_column='D0019';
Since the value has space, it doesn't detect from the where clause.
How can I select the record even it has leading and trailing spaces in the value?
My DB is ORACLE
========================================
UPDATE :
I get value only when I try
select * from my_table where my_column like '%D0019%'
not even with ' %D0019% '
=============================================
UPDATE 2 :
SELECT my_column ,DUMP(my_column) FROM my_table WHERE my_column like '%D0019';
output is
" D0019" Typ=1 Len=6: 9,68,48,48,49,57
trim(my_column)in your query.. This function removes leading and trailing spaces.SELECT my_column ,DUMP(my_column) FROM my_table WHERE my_column like '%D0019%';I guess, it is tabspace or something else. Let's check theasciivalue stored.