Example 1
select
"EMPLOYEENUMBER",
"LASTNAME",
"FIRSTNAME",
NVL((select extension from classiccars.employee where lastname = 'Murphy'), 'Unavailable'),
"EMAIL",
"OFFICECODE",
"REPORTSTO",
"JOBTITLE"
from
"CLASSICCARS"."EMPLOYEE"
Example 2
SELECT
Parcel.Alt_Key,
substr(trim(Parcel.Full_Parcel_ID),1,8) SubDiv_Number,
NVL(LS.Sub_Name,
(SELECT NVL(V2.Sub_name,'Unknown Subdivision')
FROM SUBDIV V2
WHERE substr(trim(Parcel.Full_Parcel_ID),1,8) =
substr(trim(V2.Sub_Number),1,8)
AND V2.rowid = (select min(sub2.rowid)
from SUBDIV sub2
where (trim(substr(V2.sub_number,1,8))) =
(trim(substr(sub2.sub_number,1,8)))))) SubDiv_Name,
Parcel.Full_Parcel_ID
FROM PARCEL INNER JOIN SALES
ON Parcel.Alt_Key = Sales.Alt_Key
LEFT JOIN
SUBDIV LS
ON substr(trim(Parcel.Full_Parcel_ID),1,10) =
substr(trim(LS.Sub_Number),1,10)
No comments:
Post a Comment