一个嵌套查询,我到底错在哪里? 我写了个类似的SQL好像没有错啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可能是数据精度问题.你先将子查询拆开来执行看看有没有结果即:select max(price) from shop;如果有结果再执行下面的语句select article,dealer,price from shop where price=?;看看有没有结果.下面是5.0手册上的一个例子,说明数据类型的不准确存储mysql> use test;Database changedmysql> delimiter //mysql> create procedure p() -> begin -> declare i int default 0; -> declare d decimal(10,4) default 0; -> declare f float default 0; -> while i < 10000 do -> set d=d+0.0001; -> set f=f+0.0001e0; -> set i=i+1; -> end while; -> select d,f,i; -> end; -> //Query OK, 0 rows affected (0.06 sec)mysql> delimiter ;mysql> call p();+--------+---------+-------+| d | f | i |+--------+---------+-------+| 1.0000 | 1.00005 | 10000 |+--------+---------+-------+1 row in set (0.09 sec)Query OK, 0 rows affected (0.09 sec) mysql版本是多少?4.1以上才支持子查询。 你的是4.3.4?MySQL有这个版本号吗,现在4的版本号不是才4.1.18?MySQL4还不支持存储过程,要5.x才支持,我给的例子你当然会出错了,我是想告诉你在MySQL里有些数据类型是不能准确存储的. Sorry, 我说错了,那是我的php版本号,我的是的mysql是4.0的,谢谢你们啊! 数据库基础概念迷茫,求解答??求形象的比喻 mysql命令问题 求一段mysql建库建表语句,要有表关联的语句 复制数据库存文件到另一个数据库中丢表问题 MYSQL5安裝完後,命令行登錄後,執行操作,提示錯誤 为什么Mysql占用cpu 99.9% 听说mysql从4.0开始支持transaction? 请问该使用那个数据库?mysql听说不支持事务,是吗? 在mysql里我select一个结果集,我想放在一个文件里,怎么做? 谢谢 菜鸟一个,mysql.sock和mysql.sock.lock什么关系啊 如何让MYSQL自动插入时间! 没分,就随便讨论一下!
你先将子查询拆开来执行看看有没有结果
即:
select max(price) from shop;
如果有结果再执行下面的语句
select article,dealer,price from shop where price=?;
看看有没有结果.下面是5.0手册上的一个例子,说明数据类型的不准确存储mysql> use test;
Database changed
mysql> delimiter //
mysql> create procedure p()
-> begin
-> declare i int default 0;
-> declare d decimal(10,4) default 0;
-> declare f float default 0;
-> while i < 10000 do
-> set d=d+0.0001;
-> set f=f+0.0001e0;
-> set i=i+1;
-> end while;
-> select d,f,i;
-> end;
-> //
Query OK, 0 rows affected (0.06 sec)mysql> delimiter ;
mysql> call p();
+--------+---------+-------+
| d | f | i |
+--------+---------+-------+
| 1.0000 | 1.00005 | 10000 |
+--------+---------+-------+
1 row in set (0.09 sec)Query OK, 0 rows affected (0.09 sec)
MySQL4还不支持存储过程,要5.x才支持,我给的例子你当然会出错了,我是想告诉你在MySQL里有些数据类型是不能准确存储的.