added to sql statements 'ORDER by P_id'