I need a help with sql nested sub query please. - TechRepublic
Question
March 21, 2007 at 06:49 PM
alex789

I need a help with sql nested sub query please.

by alex789 . Updated 19 years ago

Hi,
I can create this view;

CREATE VIEW view1 AS
SELECT p.bedno, p.refno, p.surename
FROM patient p
WHERE p.bedno =
(SELECT bedno
FROM bed
WHERE bedstatus = ‘USED’);

But when I “SELECT * FROM view1″, I get this error message it says ” ERROR at line 2:
ORA-01427: single-row subquery returns more than one row”.
I need count “bedstatus”, help me please.
Thank you

This discussion is locked

All Comments