Try this:
SET @auto:=0;
SELECT @auto:=@auto+1 rownum, tname
FROM table1 GROUP BY tname
Question
I have a Table which contains duplicate data in one column. I want to display unique data along with the rownum or serial number. my table has fields table1(tno,tname), in where tname has duplicate values, and I want to display the unique 'tname' data.
Solution
Try this:
SET @auto:=0;
SELECT @auto:=@auto+1 rownum, tname
FROM table1 GROUP BY tname
OTHER TIPS
Try this :
Select tname, tno
from table1
group by tname having count(*)=1
Thanks for your contributions all... I got the answer. If you get the better answer than this just share..
select @rownum:=@rownum+1 sno, a.tname FROM (SELECT DISTINCT tname from Table1) a, (SELECT @rownum:=0) r limit 60
Use UUID()
select UUID() as uniqueID FROM table1