这句话是什么意思,
存储过程:
create procedure findshop(shopname varchar(32),cgy varchar(16))
begin
delcare uid bigint unsigned;
select name ,category,content,userid into uid from myshop where name=shopname;
select *from product where userid=uid;
commit;
end;
不知道哪里出错了。
存储过程:
create procedure findshop(shopname varchar(32),cgy varchar(16))
begin
delcare uid bigint unsigned;
select name ,category,content,userid into uid from myshop where name=shopname;
select *from product where userid=uid;
commit;
end;
不知道哪里出错了。
解决方案 »
- 求SQL ...........
- Mysql有NChar类型?
- 急求 股票sql
- mysql 全文索引的cardinality是怎么算的?
- 急急!新手任务很重啊!下面是个批处理文件里的内容,怎么理解啊?利用批处理怎么以每天日期为名字自动备份数据库??
- 请教一个查询问题
- Mysql经验足者,进来看看版本问题,select * from (select * from table) t1在Mysql3.23.56 for linux报错
- 该死的MySQL,急!
- 请问mySQL的mm.mysql.driver??
- msyql同一个数据库中三个数据表内数据合并问题,困扰我啊。。。。。
- 单列索引和组合索引具体的区别和作用是什么? 有实例!
- MYSQL 生成insert语句
OR
select name ,category,content,userid into F1,F2,F3,uid from myshop where name=shopname;
改成select userid into uid from myshop where name=shopname;
select *from product where userid=uid;
这两个语句的搜索出来的结果显示出来
select userid into uid from myshop where name=shopname;
select * from product where userid=uid;
就可以了
检查shopname中的内容
建议你列出你的表结构,并提供测试数据以及基于这些测试数据的所对应正确结果。
参考一下这个贴子的提问方式http://topic.csdn.net/u/20091130/20/8343ee6a-417c-4c2d-9415-fa46604a00cf.html
1. 你的 create table xxx .. 语句
2. 你的 insert into xxx ... 语句
3. 结果是什么样,(并给以简单的算法描述)
4. 你用的数据库名称和版本(经常有人在MS SQL server版问 MySQL)
这样想帮你的人可以直接搭建和你相同的环境,并在给出方案前进行测试,避免文字描述理解上的误差。
shopid bigint unsigned not null auto_increment,
name varchar(32) not null,
category varchar(16) not null,
content varchar(400) not null,
userid bigint unsigned not null,
primary key(shopid),
unique key name(name),
unique key userid(userid)
)engine=InnoDB auto_increment=0 default charset=utf-8;create table product(
pid bigint unsigned not null auto_increment,
name varchar(32) not null,
userid bigint unsigned not null,
imagepath varchar(400) not null,
intro varchar(200) not null,
number vachar(3) not null,
upload_time date not null,
price varchar(7) not null,
primary key(pid),
unique key name(name),
key userid (userid)
)engine=InnoDB auto_increment=0 default charset=utf-8