22,209
社区成员
发帖
与我相关
我的任务
分享
exec sp_MSforeachtable 'SELECT ''?'' as tablename,* from ? WHERE CHARINDEX(N''王'',姓名)>0',
@whereand=' and left(o.name,5)=N''我爱学习网'' '
CREATE TABLE #price(tablename VARCHAR(100), ItemID VARCHAR(100),price MONEY)
exec sp_MSforeachtable 'insert into #price SELECT ''?'' as tablename,Item_ID,W_Price from ? WHERE Item_ID=''0004831''',
@whereand=' and o.name like ''price%'' '
SELECT * FROM #price