$ 0 0 Hi, Use MAX function to get max sequence for selected code in your query. Thanks & Regards,Nagarajan