By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Not showing the rows which is having the digits < 6 !!!

P: 1
Hi All,
Can anybody look into this below query? Iím running these below queries on Oracle SQL developer.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM BATCH.ITEM@SCPOREADDB WHERE ITEM LIKE '%82128%'   
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM EXCEED.CRECOVER@EXERPTDB206 WHERE PROD_ID LIKE '%82128%'
Expand|Select|Wrap|Line Numbers
  1. SELECT C.PROD_ID, I.UDC_BDMNAME, I.ITEM FROM EXCEED.CRECOVER@EXERPTDB206 C INNER JOIN BATCH.ITEM@SCPOREADDB I ON TO_CHAR(TRIM(C.PROD_ID)) = TO_CHAR(TRIM(I.ITEM)) AND I.ITEM LIKE '%82128%'
First two queries are working fine, but when I join using INNER JOIN condition it is not showing the ITEM/PROD_ID which is less than 6 digits.

Expand|Select|Wrap|Line Numbers
  1. Where PROD_ID is of type CHAR(18bytes) and ITEM is of type VARCHAR2(50Char)
It will display the rows which is having 6 digit Item & Prod_id but if it is < 6 digits those rows are not displaying while joining.

Thanks in advance...
Aug 4 '08 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
1.) Are you using Oracle? You posted this in the PostgreSQL forum
2.) Why did you trim and to_char in the query with the join when you didn't do it on the one without?
Aug 14 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.