我有这个脚本:
SELECT 'pro' as descript, COUNT(*) as cnt FROM Trade.TradesMen where TradesManAccountType_Value = 2 AND HasTradeListing = 1
UNION ALL
SELECT 'std' as descript, COUNT(*) as cnt FROM Trade.TradesMen tm
INNER JOIN Membership.Members m ON m.MemberId = tm.MemberId
INNER JOIN aspnet_Membership am ON am.UserId = m.AspNetUserId
WHERE tm.TradesManAccountType_Value = 1 AND tm.HasTradeListing = 1 AND am.IsApproved = 1
UNION ALL
SELECT 'listed' as descript, COUNT(*) as cnt FROM Trade.TradesMen where HasTradeListing = 1
UNION ALL
SELECT 'all' as descript, COUNT(*) as cnt FROM Trade.TradesMen
insert into Admin.VersionHistory values(4,cnt,CURRENT_TIMESTAMP) //is NOT correct
这会产生:
1 pro 32549
2 std 13096
3 listed 230547
4 all 231638
我想将以上内容作为行添加到我的表中:Admin.VersionHistory 具有列 VersionHistory 类型 int auto-increment 并且是 ID,Version 类型为 varchar(50) 和数据时间戳
谢谢