mysql - How to modify my query for the below requirement? -


this query can order_seq_num 2 want value column test_group_id t_patient_mhc_step_group_mapping selected order_seq_num if order_seq_num selected row value 2 in t_patient_mhc_step_mapping.

select      if((labrep.lab_status_id = 2             && labrep.mhc_status = 'mhc'),         min(stepmap.order_seq_num) + 1,         min(stepmap.order_seq_num)) step_order_seq_num     `t_patient_mhc_step_group_mapping` stepgroup         inner join     t_patient_mhc_step_mapping stepmap on stepgroup.step_id = stepmap.step_id         , stepmap.mhc_step_status = 1         inner join     `t_patient_mhc_mapping` mhcmap         inner join     `t_lab_test_report` labrep on labrep.op_ip_appt_id = mhcmap.appt_id     mhcmap.appt_id = 81 


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -