Edit query