-
SQL Query Error
When I run this SQL query, I get the following error:
injury_or_illness, cust from test where cust
LIKE (
select code from lookup where lookuparea='DEPARTMENTS' and data_id in (
select data_id from lookup_email where receipient = 'Admin'
and notification_type = 'Representative'))||'%';
ORACLE-01427: single-row subquery returns more than one row.
Is there a SQL equivalent that will achieve the above using the LIKE operator?
Thanks!
-
Wrong place, this is sql server forum.
-
Oracle Equivalant to Select Top 1 columnName, . . .
In the WHERE clause use where RowNum = 1
Select injury_or_illness, cust
from test
where cust LIKE (select code
from lookup
where lookuparea='DEPARTMENTS'
and data_id in (select data_id
from lookup_email
where receipient = 'Admin'
and notification_type = 'Representative'
)
AND ROWNUM = 1
)||'%';
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|