日期:2014-05-17 浏览次数:20401 次
--table1: #advertisers ( advertiserId bigint)
231
232
234
236
674
684
710
731
732
837
--table2: #accounts (accountId int)
1
2
3
--table: dbo.KeyWords
AccountId Date TrackingId
1 2013-07-10 18:09:01.373 xxx
2 2013-07-10 18:09:03.321 yyy
4 2013-07-10 18:09:03.321 zzz
5 2013-07-10 18:09:03.1231 ooo
select date, .dbo.ufGetTrackingId(@advertiserId)
from dbo.KeyWords
where AccountId in( select AccountId from #accounts)
declare @s varchar(100) -->函数返回什么类型,这里就定义什么类型?
set @s=dbo.ufGetTrackingId(@advertiserId) -->这个@advertiserId是外部传过来的
select date, @s as xxxx
from dbo.KeyWords a
inner join #accounts b on a.AccountId=b.AccountId