-
要求1查看全部
-
php菠菜 整形的几种类型和范围查看全部
-
@MySQL——初涉MySQL——操作数据库 一、数据库创建:CREATE 1、语法:CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [DEFAULT] CHARACTER SET [=] charset_name. 2、DATABASE和SCHEMA是相同的,任选其一 3、IF NOT EXISTS:如果创建的数据库存在,则不只报出warning,不写会报错 4、CHRARCTER SET gbk:为表设置编码方式,如果不设置则用mysql默认的编码方式 二、查看数据库列表:SHOW 1、SHOW { DATABASE | SCHEMAS } [LIKE 'pattern' | WHERE expr] 2、SHOW CREATE DATABASE xx:显示xx数据库信息 三、数据库的修改:ALTER 1、修改数据库编码方式:ALTER { DATABASE | SCHEMAS } [db_name][DEFAULT] CHARACTER SET [=] charset_name 四、删除数据库:DROP 1、删除数据库:DROP { DATABASE | SCHEMAS } [IF EXISTS] db_name;查看全部
-
显示当前服务器版本:SELECT VERSION(); 显示当前日期时间:SELECT NOW(); 显示当前用户:SELECT USER();查看全部
-
存储过程的三个优点查看全部
-
mysql命令的执行流程查看全部
-
concat() 字符的连接 concat_ws() 使用指定的分隔符进行字符连接 format() 数字格式化 lower() 转换成小写字母 upper() 转换成大写字母查看全部
-
delete t1 from tdb_goods as t1 left join (select goods_name ,goods_id from tdb_goods group by goods_name having count(goods_name)>2) as t2 on t2.goods_name=t1.goods_name where t1.goods_id>t2.goods_id;查看全部
-
ALTER TABLE tdb_goods CHANGE goods_cate cate_id SMALLINT UNSIGNED NOT NULL, CHANGE brand_name brand_id SMALLINT UNSIGNED NOT NULL;查看全部
-
UPDATE tdb_goods INNER JOIN tdb_goods_brands ON brand_name = brand_name SET brand_name = brand_id; -- Column 'brand_name' in field list is ambigous -- 正确 UPDATE tdb_goods AS g INNER JOIN tdb_goods_brands AS b ON g.brand_name = b.brand_name SET g.brand_name = b.brand_id;查看全部
-
create table goods_brands( brand_id smallint unsigned primary key auto_increment, brand_name varchar(40) not null ) select brand_name from tdb_goods group by brand_name;查看全部
-
update table tbd_goods inner join goods_cates on goods_cate = cate_name set goods_name = cate_id;查看全部
-
insert 两种方式:1:values 2:set set 可以使用子查询 insert into gooods_cates(cate_name) select goods_cate from tdb_goods group by goods_cate;查看全部
-
子查询 要扩在小括号内部。 select goods_name,goods_id ,goods_price from tdb_goods where goods_price > (select goods_price from tdb_goods where goods_cate="超级本" limit 0,1);查看全部
-
select goods_id,goods_name,goods_price from tdb_goods where goods_price >(select round(avg(goods_price))from tbd_goods)查看全部
举报
0/150
提交
取消