mysql - SQl Query for S.no -


how use sql query generating s.no 1. can't answer correctly

select (@cnt := @cnt + 1) 's.no',`barcode`, (select @cnt := 0) dummy  wp_weblib_outitems 

try this:

select  @s:=@s+1 's.no',`barcode`    wp_weblib_outitems,         (select @s:= 0) s; 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -