Mysql Query for Generate Serial Number
Simple way to make it happen.
Follow this example:
Table Name : purchase
Fields : party, amount, purchase_id (primary key)
“select party ,amount ,ROW_NUMBER() OVER (order by purchase_id)as serial from purchase”
“select *,ROW_NUMBER() OVER (order by purchase_id) as serial from purchase”
(Note : For both the Queries you will get the same output as below)
party amount serial
sam 25000 1
John 30000 2
Try this. I hope it will help you.