1.三个函数: LENGTH SUBSTR LOCATE
select * from hbl_product where LENGTH(SUBSTR(WebSiteShopUrl,LOCATE('=',WebSiteShopUrl)+1))=4 order by WebSiteShopUrl desc
2.序号 两种方法
第一种方法:
select (@i:=@i+) as i,table_name.* from table_name,(select @i:=) as it
第二种方法: set @rownum=;
select @rownum:=@rownum+ as rownum, t.username from auth_user t limit ,;
3.ifnull 如果为null,则为0
ifnull(hci.Count,0)