我建了两个表 一个是text(name,dname)一个是text1(num,item),text表里有一条记录是(安全,text1),我想要通过text表来查询text1中所有值。我用的是select * from (select dname where name='安全');但是错误。请问应该怎么编写代码。谢谢了,急!奖励很高啊!
解决方案 »
- mysql cast语句将某种类型转化为4个字节的int
- sql 语句优化
- PG数据库表分区的实现疑问。
- 我使用的是mysql4.1,但里面没有winmysqladmin这个工具啊,怎么回事?是不是省略了?感谢
- 关于mysql的text查询问题
- 救命!!!为什么不能还原含有外键的表?
- 我在另外的机器上连接数据库,用这样MYSQL -H 192.168.0.1 -U ROOT -P391100 为什么说ERROR 1045: Access denied for user: 'root@billga
- 为什么我输入http://...../aabbcc.sql时出现是的文件内容啊
- mysql+delphi字段问题
- mysql fabric使用split分片出错
- 有没有比较好的办法横向合并查询结果
- ArcGis engine+eclipse java实现
select into @x from text where name=‘安全’;
查询TEXT1表,
set @ww=concat('select * from ',@x)
prepare qq from @ww;
execute qq
在SP中直接使用,可以不用定义
DECLARE @te varchar(100)
set @te=(select dname where name='安全')
exec('select * from ' + @te )
set @te=(select dname where name='安全')
exec('select * from ' + @te )