SQL学习

SELECT (SELECT WXName FROM UserInfo where id=[UserMoneyLog].userid) as NickName, Money FROM [dbo].[UserMoneyLog] where Money>0 and ActivityId=21

 

远程服务器非本机服务器地址写法

39.105.136.137\SQLEXPRESS,1433

 

导出tx数据

SELECT (select WXName FROM UserInfo where id=[Trade].UserId) AS WXName, Money, PayedTime, 'succeed' FROM [dbo].[Trade] where TradeType=2 and Status=2 and typeid=46 order by PayedTime desc

 

KPI导出

SELECT (SELECT WXName FROM UserInfo where id=[UserMoneyLog].userid) as NickName, Money,CreateTime , 'succeed' FROM [dbo].[UserMoneyLog] where Money>0 and ActivityId=53

 

分享导出

select b.NickName,a.Points,  a.AddTime ,'succeed' from PointsLogs a left join Accounts b on a.AccountId=b.Id where a.ActivityId=41

 

你可能感兴趣的:(SQL学习)