I have the SQL statement that I am not sure of the syntax in the WHERE clause.
If I search for only 'SUSPEND_MAN_ANN_SCHEDULE', I will have a recordset returned. However, if I add anymore AND's after that one, I will get no records returned. If I use OR, the SQL Worksheet just hangs and does not return anything. So what's the correct syntax to execute this PL/SQL.
Thanks,
Todd
Code:
SELECT a.ANN_EVENT_ID,
b.ANN_EVENT_NUM,
b.ANN_EVENT_TYPE_ID,
DECODE(a.TYPE, 'ADHOCMBTA', 'ADHOC', 'LIVEMBTA', 'LIVE', 'STOPMBTA', 'STOP', a.TYPE)
AS TYPE,
ANN_EVENT_PKG.GetStations(a.ANN_EVENT_ID, a.time_stamp,b.ANN_EVENT_NUM) AS STATIONS,
b.NAME AS EVENT_TYPE
FROM ANN_EVENT_MSG a,
(select a.ann_event_id, a.ann_event_num,
a.ann_event_type_id, MIN(a.time_stamp) as min_time_stamp,
b.name
from ann_event a,
ann_event_type b
where a.ann_event_type_id = b.ann_event_type_id
group by a.ann_event_id, a.ann_event_num, a.ann_event_type_id, b.name) b
WHERE a.ANN_EVENT_ID = b.ANN_EVENT_ID AND
b.NAME = 'SUSPEND_MAN_ANN_SCHEDULE' AND
b.NAME = 'SUSPEND_MAN_ANN_STATION' AND
b.NAME = 'SUSPEND_AUTO_ANN_STATION'
ORDER BY a.ANN_EVENT_ID, b.ANN_EVENT_NUM;
If I search for only 'SUSPEND_MAN_ANN_SCHEDULE', I will have a recordset returned. However, if I add anymore AND's after that one, I will get no records returned. If I use OR, the SQL Worksheet just hangs and does not return anything. So what's the correct syntax to execute this PL/SQL.
Thanks,
Todd