My Thoughts & Views

Row ID in Mysql and Using it for Serial Number

Posted on: September 6, 2007

SET @rownum := 0;
select @rownum :=@rownum + 1 AS rank,EmpID,EmpName,EmpCity from employeedetails where empname =’kiran’

Carry over a value from previous row.

Advertisements

4 Responses to "Row ID in Mysql and Using it for Serial Number"

do you know how can this logic be encapsulated in a single view? ie:

“Create or Replace View TEST as set @rownum; select …

do you know how can this logic be encapsulated in a single view? ie:”Create or Replace View TEST as set @rownum; select …

Yeah you can do it. it is pretty much straight forward.

Yeah you can do it. it is pretty much straight forward.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: