select count(*) from ec_picklist_items where picklist_item_id=:picklist_item_id and sort_key=:sort_key select count(*) from ec_picklist_items where picklist_item_id=:next_picklist_item_id and sort_key=:next_sort_key update ec_picklist_items set sort_key=:next_sort_key where picklist_item_id=:picklist_item_id update ec_picklist_items set sort_key=:sort_key where picklist_item_id=:next_picklist_item_id