I created a view from tables using these queries
CREATE VIEW AVAIL_TOOLS AS
SELECT T.TOOL_NAME AS "Name", R.RETAILER_NAME AS "Retailer", T.RETAILER_NUM AS "Number", I.TI_STATUS AS "Status",
(SELECT
CASE
WHEN DETAIL_RETURNDATE IS NULL THEN TO_CHAR(DETAIL_DUEDATE,'Day, Month, DD, YYYY')
ELSE 'Now' END FROM DETAILRENTAL) AS "Expected Avaliablity"
FROM TOOL T
INNER JOIN RETAILER R
ON T.RETAILER_NUM = R.RETAILER_NUM
INNER JOIN TOOLINSTANCE I
ON T.TOOL_NUM = I.TOOL_NUM
WHERE (I.TI_STATUS = 'Rented') OR (I.TI_STATUS = 'Available')
ORDER BY T.TOOL_NAME;
now when I try to run SELECT * FROM AVAIL_TOOLS I receive the error ORA-01427: single-row subquery returns more than one row. The case I am running in the query obviously seems to be the problem. Now is there anyway I could change the queries around. I am trying to create a view where if the return date is null it will be available when it is returned other wise it should be now.
I'm at a loss on how I should change about to get the resulted needed.