Is it possible to create auto increment id column in mysql view?

后端 未结 4 1718
南笙
南笙 2021-01-18 10:04

I have created a view in MySql. But now my requirement is to create an Id column in that view which should be auto increment.

My current view is:-

CR         


        
4条回答
  •  野的像风
    2021-01-18 10:40

    select @rownum:=@rownum+1 'autoID',m.mediaThumbnailUrl , q.surveyID from (SELECT @rownum:=0) r, media m join question q on m.mediaAutoID = q.backgroundImageID ;

提交回复
热议问题