sql1 = SELECT DISTINCT wr_parent FROM g5_write_rankup_jee1 WHERE wr_num IN (-239,-240,-242,-243,-244,-264,-274,-305,-316,-317,-331,-331,-331,-331) sql4 = SELECT wr_id FROM g5_write_rankup_jee1 WHERE wr_num IN ('-331','-331','-331','-331','-317','-316','-305','-274','-264','-244','-243','-242','-240','-239')