Fix MySQL Query Syntax

via Freelancer ·

Budget / Salary$10–30
TypeFreelance project
LocationRemote
Posted1 hour ago
I have a short SELECT statement that throws “#1241 – Operand should contain 1 column(s).”
What I want is simple: return nombre, apellido, especialidad1, especialidad2 and categoria from table nancy, but only for the rows whose (nombre + apellido) pair also appears in table visitas5. The final results must stay ordered by especialidad1 ASC and I am not asking for any new indexes or performance tweaks right now.

The task is to rewrite the query so it runs without errors and produces exactly that dataset. Please send back the corrected SQL (JOIN, EXISTS, or any other valid MySQL approach), along with a brief note explaining why the original version failed.

This is my current query:

SELECT nombre, apellido, especialidad1,especialidad2,categoria
FROM pamela
WHERE nombre and apellido IN (SELECT nombre, apellido FROM visitas6) order by especialidad1 asc;
php data processing sql mysql database administration database programming database development data analysis data integration database management
Apply on Freelancer →

Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.