mysql

 使用 WITH ROLLUP:

正则表达式:

order by rand()随机抽取几个

 

 

mysql中查询一个字段具体是属于哪一个数据库的那一张表:
select table_schema,table_name from information_schema.columns where column_name = '字段名'

根据另一张表中字段更新本表:

update xx_v v,xx_g g set v.cate =  g.cate where g.id = v.r_id

查询字段中包含反斜杠\:

select * from xx_goods where items like '%A\\\\M%'

select * from xx_goods where items like '%\\\%'或select * from xx_goods where items like '%\\\\%'

hql查询条件中模糊搜索忽略大小写和空格,以及处理字段本身包含单引号的情况:

String yuan = "Neal's Yard Remedies";
String name =yuan.replaceAll("'", "''");
String hql="select name from table_name where replace(name,' ','')  like replace(\'%"+name+"%\',' ','');

查询出的数据带序号:

select (@i:= @i+1) as rownum,o.created_date from table o,(select @i:= 0) a

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值