日期:2014-05-20  浏览次数:20480 次

这个语句应该怎么用inner join?
create   table   #dbfTable
(code   int   ,   [open]   decimal)
insert   into   #dbfTable
(code   ,   [open])  
select   code   ,   [open]
  from   openrowset
( 'msdasql ', 'driver=microsoft   visual   foxpro   driver;sourcetype=dbf;sourcedb=D:\qh(1) ', 'select   *   from   [all.dbf] ')

inner   join   all_code   on   #dbfTable.code   =   all_code.code


我加了最后一个inner   join就报错了应该如何写这个语句??

------解决方案--------------------
你的表是空的,你是往裡面插入數據,不需要inner join

create table #dbfTable
(code int , [open] decimal)
insert into #dbfTable
(code , [open])
select code , [open]
from openrowset
( 'msdasql ', 'driver=microsoft visual foxpro driver;sourcetype=dbf;sourcedb=D:\qh(1) ', 'select * from [all.dbf] ')