我尝试在这里添加一个where子句:
select `submission_id`,
max(case when `key` = 'id_usuario' then value end) as user,
max(case when `key` = 'date_atualizado' then value end) as Data,
max(case when `key` = 'peso' then value end) as Peso
from wp_e_submissions_values
group by `submission_id`
它工作得很好!但是我需要添加WHERE 'user' = 1
select `submission_id`,
max(case when `key` = 'id_usuario' then value end) as user,
max(case when `key` = 'date_atualizado' then value end) as Data,
max(case when `key` = 'peso' then value end) as Peso
from wp_e_submissions_values
WHERE 'user' = 1
group by `submission_id`
我在FROM之后添加了...但它不起作用。我收到以下错误:
Attention: #1292 Truncated wrong DOUBLE value: 'user'
你们能帮帮我吗?
1条答案
按热度按时间wi3ka0sx1#
仔细阅读您的问题后,看起来
user
上的Assert应该发生在HAVING
子句中,而不是WHERE
子句中。