I have table ordertable{customer_id,oid,order_quantity,Order_amount,date}
in this table i want generate oid as(o1,o2,o3,o4..............etc) and make this as primary key.Is it possible in mysql
Please help me.
Thanks
解决方案Hello,
You can not directly do so. However this article[^] should help you in achieving this.
Regards,
I don't encourage you to use nvarchar column as a primary key.
Why ? Because indexing an nvarchar is much more costly than an integer type.
Better have an autogenerated primary key of integer type ; this does not prevent the use of a nvarchar column to store a generated order id. By doing this you will have much better performances when you will query your orders table.