数据库常用SQL语句

1、把时间字段(毫秒类型)转换给时间类型后,并且输出表中的所有字段

例如:

requesttime为请求时间字段(毫秒类型),nxllfx.trcd_wapdetail_20 t为表名。

select num_to_date(t.requesttime),t. * from nxllfx.trcd_wapdetail_20 t;

2、更新表中时间字段

例如:

更新表tmrk_result中的mrkdatetime字段的时间值。

update tmrk_result set mrkdatetime=to_date('2012-09-20 16:30:30','yyyy-mm-dd hh24:mi:ss') where phonenumber='13912300035';

3、如何在linux下查看mysql所有用户信息

select distinct concat('user: ''',user,'''@''',host,''';')as query from mysql.user;
  

猜你喜欢

转载自chouchouyuan.iteye.com/blog/1706297