摘要:系统中有这样一个表table_ids,parrent_ids保存的是一串用逗号隔开的id 需求:以orleid为依据,拼接id、parent_ids,同时要求去除重复的id。 思路:先拼接id、parent_ids为一个字符串(暂且叫idstr),去除最后一个逗号,然后以roleid为依据,把ids
阅读全文
随笔分类 - mysql
摘要:SELECT POSITION('2' IN '1234')
阅读全文
摘要:grant all privileges on *.* to name@localhost identified by '1'; flush privileges;
阅读全文
摘要:1:修改/etc/my.cnf 2:重启服务 3:进入mysql 4:修改密码 5:刷新权限 注意:修改完成后,别忘了修改/etc/my.cnf,删除skip-grant-tables,否则重启服务后,可以不需要帐号密码直接登录数据库。
阅读全文
摘要:select (@i:=@i+1) as i,table_name.* from table_name,(select @i:=0) as it
阅读全文
摘要:select distinct name from table
阅读全文
摘要:函数:DATE_FORMAT http://www.w3school.com.cn/sql/func_date_format.asp
阅读全文

浙公网安备 33010602011771号