I want to Create a table which would generate automatic unique I'd for each record in SQL.
Can you suggest by using create table, varchar, etc,
Hi @Dhiraj Kr_ Gupta ,
To get a unique ID for a record, you may use the UUID() function:
SELECT UUID() AS 'Universal Unique Identifier',
*
FROM T*
The IDs will be unique within the current source table but they will be updated every time you publish the page.
So, if you need them as passwords, primary keys, etc. you may generate them once and then copy to a real column of your existing table.
If your case is that you have smth like Surname, Name, Department, Column 1 - Column N in your first table and Surname, Name, Department, Column N+1 - Column N+N in your second table, but you can't look up them because the surnames are not unique, you may use the following workaround: just concatenate the first three common columns.
As a result, you'll get a key column that is Surname + Name + Department. This column will be a unique one, so, you'll be able to look up your tables just fine.
Hope I was able to make myself clear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.