gpt4 book ai didi

mysql - 没有字符的 SQL SELECT 项

转载 作者:行者123 更新时间:2023-11-29 05:57:32 25 4
gpt4 key购买 nike

我有以下 SQL:

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

但我只想要SELECT items WHERE marker not = "D"

我必须在这个 select 查询的什么地方添加它?

最佳答案

像下面这样使用它:

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)

关于mysql - 没有字符的 SQL SELECT 项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47994472/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com