摘要:
常用的内置函数,常用select\字符串函数contat('' , '', .....) //连接字符串 select concat(name, ' age is ', age) from persons;insert(a, 2, 3, insert) //将字符a的第2个位置开始,3个字符替换为insertmysql> select name, insert(name, 2, 3, 'hello') from persons;+------------+-----------------------------+| nam 阅读全文
摘要:
select * from products where id in(select id from cats where name like '%java%');//查找类型中名字中包含java的的商品信息order by 字段名字 desc /ascselect * from products order by price desc;//按照降序排列limitselect * from products order by price limit 1;//取出价格便宜的商品select * from products where id select * from product 阅读全文
摘要:
多表查询时,要给表名起别名,给字段名其别名(当两个表含有重复字段时)select p.name, c.name, pid from products p, cats c;//得到的结果为笛卡尔乘积select p.name as pname, p.price, p.desn, p.num from products p, cats c where c.id = p.cid ;//查询所有商品属于哪个分类select p.name as pname, p.price, p.desn, p.num from products p, cats c where c.id = p.cid and c.n 阅读全文
摘要:
http://hi.baidu.com/kevin276/item/29bc1c96a208fabc82d29542sudo dpkg -i google-chrome-stable_current_amd64.debsudo apt-get -f install 阅读全文