SQL查询不存在

时间:2015-05-05 17:53:41

标签: mysql sql sql-server nested-queries

我们有两个销售不同类型商品的系统。与沙盒2中的帐户相比,我们希望在Sandbox1中仅显示客户帐户。我已经使用了WHERE NOT EXISTS,但我不确定它是否正常工作。当我尝试运行它时出现错误:将nvarchar值'MSTO15'转换为数据类型int时转换失败。因此,我不确定是什么导致了这种情况,或者我是否正在使用我的查询。

任何帮助都将不胜感激。

var passedDict = passed.ToDictionary(p => p.DataDate, p);
var failedDict = failed.ToDictionary(p => p.DataDate, p);

var startedOn = DateTime.....
var endedOn = DateTime....

var combined = Enumerable
  .Range(0, 1 + endedOn.Subtract(startedOn).Days)
  .Select(x => 
    {
      Pass pass;
      Fail fail;

      var result = new ReportData()
      result.DataDate = staredOn.AddDays(x),

      if (passedDict.TryGetValue(result.DataDate, out pass))
      {
        result.Quantity = pass.Quantity;
        result.CumulativeQuantity = pass.CumulativeQuantity;
      }

      if (failedDict.TryGetValue(result.DataDate, out fail))
      {
        result.Rejected= fail.Rejected;
        result.CumulativeRejected = fail.CumulativeRejected ;
      }

      return result;
    })
  .ToList();

2 个答案:

答案 0 :(得分:1)

public void rotateAroundCenter(float degrees) {
    ending.vector.Vector2f center = SpriteUtils.getTextureCenter(TileTextures.DOORTEXTURE);
    ending.vector.Vector2f rotateOrigin = new ending.vector.Vector2f(sprite.getPosition()).add(center);
    transform = Transform.rotate(transform, degrees, rotateOrigin.x, rotateOrigin.y);
}

答案 1 :(得分:0)

试试这个:

SELECT [Account #], Accounts, [Prior Annual], [Prior Annual1], [Prior Annual2]
FROM Sandbox1.dbo.SalesHistory as s
where s.[Account #] not in (select [Account #] from Sandbox2.customer_master)