-
select goods_id, goods_name,goods_price from tdb_goods where goods_price != all (select goods_price from tdb_goods where goods_cate='caojiben');查看全部
-
select goods_id, goods_name,goods_price from tdb_goods where goods_price> any (select goods_price from tdb_goods where goods_cate='caojiben'); 返回的都是大于4299 的查看全部
-
子查询返回多余一个的时候用any some all 来做修饰 select goods_id, goods_name,goods_price from tdb_goods where goods_price> ANY (select goods_price from tdb_goods where goods_cate='caojiben');查看全部
-
any some all查看全部
-
select goods_id, goods_name,goods_price from tdb_goods where goods_price>(select goods_price from tdb_goods where goods_cate='caojiben'); // 错误 子查询明确返回多余一行 返回有三行 4999 4299 7999查看全部
-
查找超极本商品的价格 select goods_price from tdb_goods where goods_cate='caojiben';查看全部
-
将上两个合并到一起 通过子查询 select goods_id,goods_name,goods_price from tdb_goods where goods_price >=(select round(avg(goods_price),2) from tdb_goods);查看全部
-
select goods_id ,goods_name, goods_price from tdb_goods where goods_price>=5636.36;查看全部
-
operand comparison_operator select avg(goods_price) from tdb_goods; select round(avg(goods_price)) from tdb_goods;查看全部
-
distinct group by order by limit select insert update set do查看全部
-
子查询 select * from t1 where col1 = (select col2 from t2); select * from t1 外查询 outer query select col2 from t2 子查询 subquery查看全部
-
is_show BOOLEAN NOT NULL DEFAULT 1, is_saleoff BOOLEAN NOT NULL DEFAULT 0 );查看全部
-
CREATE TABLE IF NOT EXISTS tdb_goods( goods_id SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, goods_name VARCHAR(150) NOT NULL, goods_cate VARCHAR(40) NOT NULL, brand_name VARCHAR(40) NOT NULL, goods_price DECIMAL(15,3) UNSIGNED NOT NULL DEFAULT 0, is_show BOOLEA查看全部
-
修改属性 alter table tdb_goods modify goods_price decimal(15,3) unsigned not null default 0.000;查看全部
-
create table tdb_goods( goods_id smallint unsigned auto_increment primary key, goods_name varchar(150) not null, goods_cate varchar(40) not null, brand_name varchar(40) not null, goods_price decimal(15,3) unsigned default 0.000, is_show tinyint(1) default 1, is_saleoff tinyin(1) default 0);查看全部
举报
0/150
提交
取消