Oracle SQL - Parameter in where condition to search two values from one [message #649616] |
Fri, 01 April 2016 03:40 |
azocomposto
Messages: 2 Registered: May 2010
|
Junior Member |
|
|
Hi all,
I have this case: In my database, the companys are identified in the I_COMPANY table with a unique code in IC_COMPANY_CODE column and a description in IC_COMPANY_DESC column.
Example of records:
The IC_COMPANY_DESC = 'ATLANTA', is identified by two IC_COMPANY_CODE = 901 and 902.
The IC_COMPANY_DESC = 'TORONTO', is identified by two IC_COMPANY_CODE = 903 and 904.
In this example query SQL, in the WHERE condition I want insert a parameter :IC_COMPANY_CODE = '901' and the query search result, must display in a dataset 901 and 902 records, how to write this query?
SELECT IC_COMPANY_CODE, IC_COMPANY_DESC
FROM I_COMPANY
WHERE IC_COMPANY_CODE = :IC_COMPANY_CODE -- > how to insert 901 string and display result for 901 and 902?
How can I resolve this problem?
Thanks
|
|
|
|
|