没有字符的SQL SELECT项

时间:2017-12-27 15:12:55

标签: mysql sql sorting

我有以下SQL:

SELECT items WHERE marker not = "D"

但我只想要select

我必须在此let rawData = AVCapturePhotoOutput.dngPhotoDataRepresentation(forRawSampleBuffer: self, previewPhotoSampleBuffer: nil)! let options: [AnyHashable : Any] = [ kCIInputNoiseReductionAmountKey: 0.0, kCIInputLuminanceNoiseReductionAmountKey: 0.0, kCIInputColorNoiseReductionAmountKey: 0.0] let rawFilter = CIFilter(imageData: rawData, options: options)! let outputImage = rawFilter.outputImage! let context = CIContext() let cgImage = context.createCGImage(outputImage, from: outputImage.extent)! let uiImage = UIImage(cgImage: cgImage) let data = UIImageJPEGRepresentation(uiImage, jpegQuality)! // Save the data using PHPhotoLibrary 查询中添加此内容吗?

2 个答案:

答案 0 :(得分:2)

使用如下:

SELECT 
    M.* 
FROM 
    (
   SELECT MAX(counter) AS FirstUserDate, imdb_id, language, season, aufloesung, episode
   FROM autofehlerserie 
   WHERE marker <> 'D'
    GROUP BY imdb_id, language, season, aufloesung, episode
    ) foo 
    JOIN
    autofehlerserie M ON foo.imdb_id = M.imdb_id AND foo.language = M.language and M.marker <> 'D'
ORDER BY
    foo.FirstUserDate DESC, M.imdb_id, M.aufloesung, cast(M.season as int), cast(M.episode as int)

答案 1 :(得分:0)

我想你可能真的想要:

select m.*
from autofehlerserie m
where not exists (select 1
                  from autofehlerserie m2
                  where m2.imdb_id = m.imdb_id AND m2.language = m.language and
                        m2.marker = 'D'
                 );

这将返回表格中没有其他行的所有行,其中imdb_idlanguage marker'D'。{/ p>