cwilli35
Starting Member
17 Posts |
Posted - 2009-05-14 : 13:10:03
|
Hello All...When running the below isted SQL, I receive the following error upon execution: "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.The statement has been terminated."How can I fix this? Thanks.INSERT INTO AltirisHDS_TEST.dbo.workitem(source, external_reference, priority_lookup_id, status_lookup_id, category_lookup_id, type_lookup_id, category_tree_value, assigned_to_worker_id, created_by_worker_id, modified_by_worker_id, created_by_worker_contact_id, modified_by_worker_contact_id, created_on, minutes_spent, [action], title, managed_object_id, contact_id, tag_collection_id, is_scheduled, bulletin_status, comment, auxdata, total_minutes_spent, owned_by_worker_id, rating, comment_visible_to_guest, rules_fired, updatelock, urgency_lookup_id, impact_lookup_id, close_code_lookup_id, modified_by_rule_guid, modified_by_rule_history_id, modified_by_workitem_number, modified_by_workitem_version, organization_lookup_id)SELECT (Select distinct C4 From ARRemedy_TEST.dbo.T10 Where Exists (select distinct ARRemedy_TEST.dbo.T10.C1, ARRemedy_TEST.dbo.T33.C538000011, ARRemedy_TEST.dbo.T10.C4 AS Assigned_to, ARRemedy_TEST.dbo.T10.C538000109FROM ARRemedy_TEST.dbo.T10, ARRemedy_TEST.dbo.T33 WHERE ARRemedy_TEST.dbo.T10.C538000030 = ARRemedy_TEST.dbo.T33.C538000030 AND ARRemedy_TEST.dbo.T10.C1 = ARRemedy_TEST.dbo.T33.C538000245)), T10.C1, case T10.C538000103When 'HIGH' then 200 When 'MEDIUM' then 300 When 'LOW' then 400 else 200 end, case T10.C538000109 When 'Requested' then 200When 'Resolved' then 400 When 'Initiated' then 525 When '[In] Progress' then 538When 'Pending CAB Approval' then 550 When 'Release Management' then 575 When 'Pending EDS' then 588When 'Pending MCNOSC' then 594 When 'Closed' then 600 else 200 end,1, 10, 'Application Maintenance\Software Maintenance', 5, 5, 5, 5, 5, dateadd(second, T10.C3,'1970-01-01'), 0, 'In Progress', 'REMEDY TO ALTIRIS DATA CONVERSION', 5, 5, 5, 0,'i', T10.C538000144, T10.C4, 0, 5, 0, 1, '620,638,644,352,319', 'd', 200, 200, 100, '00000000-0000-0000-0000-000000000000', 0, 0, 0,case T10.C538000114When '[Not] Specified' then 50When 'Headquarters' then 100When 'Logistics Operation Center' then 200When 'Logistics Capabilities Center' then 300When 'Supply Management Center' then 400When 'Maintenance Management Center' then 500When 'Program Support Center' then 600When 'Distribution Management Center' then 700When 'Manpower' then 800When 'Workforce Development Office' then 900When 'Command Inspection EEO Office' then 1000When 'Office [of] Counsel' then 1100When 'Strategic Communications and Change Management' then 1200When 'Programs and Resources Office' then 1300When 'Contracts Department' then 1400When 'Command Control Computers and Communications' then 1500When 'Installations Environment & Safety Office' then 1600When 'Logistics Modernization' then 1700When 'Small Business Office' then 1800When 'Band' then 1900else 50endFROM ARRemedy_TEST.dbo.T10 T10WHERE T10.C538000109 != 'Closed' |
|