sql - I want project_manager column which is not null -
query sql :: want project_manager column not null alias name. want query having null in project_manager. having trouble getting required query(project_manager having null). how can ?
select t_gps_applications.application_id, t_gps_applications.application_name, (select u.first_name || ' ' || u.middle_name || ' ' || u.last_name tas.t_users u, t_gps_app_properties ap to_char(u.user_id) = ap.property_value , ap.property_name = 'project_manager' , ap.application_id = t_gps_applications.application_id) project_manager, decode(t_gps_applications.visible_flag, 'false', 'closed', decode((select count(1) t_gps_instances gi gi.application_id = t_gps_applications.application_id), 0, 'not started', decode((select count(1) t_gps_instances gi, t_gps_workflow_states ws gi.application_id = t_gps_applications.application_id , gi.instance_present = 1 , (gi.active = 1 or gi.active null) , gi.current_state_id = ws.state_id , ws.state_descriptor not in ('workflow end', 'and state')), 0, 'completed', 'running'))), t_gps_applications.visible_flag stategps.t_gps_applications t_gps_applications, stategps.t_gps_app_properties t_gps_app_properties t_gps_applications.application_id = t_gps_app_properties.application_id , (t_gps_app_properties.property_value = 'true' , t_gps_app_properties.property_name = 'projectplan_application'); select * t_gps_app_properties ap;
have tried not exists
condition ? have no database try though...
i took liberty remove project_manager column, return null
value
select t_gps_applications.application_id, t_gps_applications.application_name, decode(t_gps_applications.visible_flag, 'false', 'closed', decode((select count(1) t_gps_instances gi gi.application_id = t_gps_applications.application_id), 0, 'not started', decode((select count(1) t_gps_instances gi, t_gps_workflow_states ws gi.application_id = t_gps_applications.application_id , gi.instance_present = 1 , (gi.active = 1 or gi.active null) , gi.current_state_id = ws.state_id , ws.state_descriptor not in ('workflow end', 'and state')), 0, 'completed', 'running'))), t_gps_applications.visible_flag stategps.t_gps_applications t_gps_applications, stategps.t_gps_app_properties t_gps_app_properties t_gps_applications.application_id = t_gps_app_properties.application_id , (t_gps_app_properties.property_value = 'true' , t_gps_app_properties.property_name = 'projectplan_application') , not exists (select u.* tas.t_users u, t_gps_app_properties ap to_char(u.user_id) = ap.property_value , ap.property_name = 'project_manager' , ap.application_id = t_gps_applications.application_id)
Comments
Post a Comment