Fix MySQL Query Syntax

Employer not named by the sourceRemote

DatabaseFull Stack

Apply on the company’s site

Frontier is not the employer and does not collect applications.

About this role

PHP, Data Processing, SQL, MySQL, Database Administration, Database Programming, Database Development, Data Analysis, Data Integration, Database Management · 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;