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

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -