我有一张下表,代码值可以是1到10。我只想选择产品,如果它的代码值大于或等于3并且不应该分配代码= 9。
Declare @Product Table(ProductId INT, Code DECIMAL(10,2))
INSERT INTO @Product(ProductId, Code)
Select 844558,3
UNION
Select 844558,3.5
UNION
Select 844558,4
UNION
Select 296013,2
UNION
Select 296013,3
UNION
Select 494948,3.5
UNION
Select 494948,4
UNION
Select 494948,9
UNION
Select 392991,4
UNION
Select 392991,9.5
SELECT ProductId
FROM @Product
WHERE Code <> 9
GROUP BY ProductId
HAVING MIN(Code) >= 3
结果将只有产品ID 844558和392991。 未选择296013,因为已为其分配了代码2 未选择494948,因为它的代码为9
我在下面的查询中写道,以选择代码大于或等于3的记录。如何排除代码= 9的产品
public function videoLinkChecker()
{
dispatch(new VideoLinkCheckerJob());
return back()->with('success', 'İşlem başlatıldı tamamlandığında raporu Eğitimler sayfasında görüntüleyebilirsiniz!');
}
答案 0 :(得分:1)
增强您的 func getImage(asset: PHAsset) -> UIImage{
let fetchOptions = PHFetchOptions()
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
fetchOptions.fetchLimit = 1
let fetchResult = PHAsset.fetchAssets(with: .image, options: fetchOptions)
if (fetchResult.firstObject != nil) {
var lastAsset: PHAsset = fetchResult.lastObject as! PHAsset
var image = UIImage()
PHImageManager.default().requestImage(for: lastAsset, targetSize: CGSize(width: 100, height: 100) , contentMode: .aspectFill, options: PHImageRequestOptions(), resultHandler: { (result, info) -> Void in
image = result!
})
return image! //Cannot force unwrap value of non-optional type 'UIImage'
}
}
子句:
having
答案 1 :(得分:0)