0
Could anyone help me with this problem? The query below throws the following error:
#1054 - Unknown column 'u.idocorrencia' in 'Where clause'
SELECT DISTINCT * FROM(
(SELECT o.*, u.nome AS requerente FROM ocorrencia o, utilizador u WHERE u.idutilizador = 2 AND perfil = 2)
UNION ALL
(SELECT o1.*, u1.nome AS tecnico FROM utilizador u1, ocorrencia o1 WHERE u1.idutilizador != 2 AND u1.perfil = 1)
) AS t WHERE u.idocorrencia = u1.idocorrencia and u.requerente <> u1.tecnico
The tables involved in the query are:
tabela utilizador (idutilizador, nome, perfil);
tabela ocorrencia (idocorrencia, ocorrencia, descricao);
tabela utilizador_ocorrencia (ocorrencia_id, utilizador_id);
What error? What do you expect to return with this query? Click [Edit] and add these details to the question.
– user28595
#1054 - Unknown column 'u.idocorrencia' in 'Where clause'
– imheliomagalhaes
I hope to resume the reputation | Subject | Description | Applicant | Technical
– imheliomagalhaes
Note: applicant and technician are part of the user table
– imheliomagalhaes