table_1
name id
a 1
b 2
c 3table_2
id
1
2
我想得到 值a b ,有分
With adoQuery1 do
begin
Close ;
SQL.Clear;
SQL.Add('Select name From table_1 Where (table_1.id = table_2.id)');
Open;
end;
为什么执行后出现以下错误呢?
the column prefix 'table_2' does not match with a table
name or alias name used in the query
name id
a 1
b 2
c 3table_2
id
1
2
我想得到 值a b ,有分
With adoQuery1 do
begin
Close ;
SQL.Clear;
SQL.Add('Select name From table_1 Where (table_1.id = table_2.id)');
Open;
end;
为什么执行后出现以下错误呢?
the column prefix 'table_2' does not match with a table
name or alias name used in the query
解决方案 »
- 急求大神指教
- 请问delphi是否有压缩和解压字符串函数?
- 为了推广软件,散尽可用分了
- 怎么把大量图片打包
- 如何处理带分隔符的文本文件
- 100分求有现成的Delphi7示例数据库dbDemos的Access版?
- windowxXP+D6+ACCESS程序运行弹出个CPU窗口,不知怎么回事。(----在线等)
- xinshiji(无名),进来!!!!
- 一个网络上常见的情况在delphi里怎么实现?
- 求助:用QReport时,怎样在detail中动态生成TQRLabel?一定给分
- 哪里有关于DBGridEh控件的使用说明下载?
- 老问题:怎样用AdoQuery往SqlServer中保存Word文件?我试了,老出错。在线等待!!多谢!!
s: String;
begin
With adoQuery1 do
begin
Close ;
SQL.Clear;
SQL.Add('select id from Table_1 where name = ''a''');
Open;
end;
s := ADOQuery1.Fields[0].AsString; //s是你需要的a值!
end;
SELECT id FROM table1 INNER JOIN table2 ON table1.id = table2.id
A.id
FROM table_1 A
JOIN table_2 B
ON A.id = B.id
ft你了,连表名table_2都没有给出。