
Closed
Posted
Paid on delivery
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;
Project ID: 40671044
125 proposals
Remote project
Active 2 days ago
Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
125 freelancers are bidding on average $22 USD for this job

I can definitely fix that “Operand should contain 1 column(s)” error for your MySQL SELECT statement. I've built many queries that combine data from multiple tables. Here's what I'll do for you: • Write a new SQL query that grabs the `nombre`, `apellido`, `especialidad1`, `especialidad2`, and `categoria` from `nancy` (not `pamela`) based on the `nombre` + `apellido` pair in `visitas5`. • Make sure the results are ordered by `especialidad1` ASC, just like you asked. • Give you a quick explanation of why your original query failed with that specific error. I can have this ready for you in just a few hours. You only pay once the query runs perfectly and you're completely happy with the results. Let's get this query working for you.
$20 USD in 1 day
8.5
8.5

Hi there, I can see the issue immediately: the subquery returns two columns, but your WHERE clause is written in a way MySQL can’t evaluate as a valid row comparison, which triggers #1241. I’ve fixed this kind of MySQL syntax problem many times in PHP/MySQL and WordPress custom work, and I’ll rewrite it cleanly using a JOIN or EXISTS so it returns exactly nombre, apellido, especialidad1, especialidad2, and categoria, ordered by especialidad1 ASC. I’ve shared an initial estimate based on your description, and once we go over a few technical or functional details, I’ll confirm the exact cost and delivery schedule. I’ll also briefly explain why the original query failed and provide the corrected SQL you can run right away. Would you like the corrected version written as a JOIN or an EXISTS query, and should I match the tables exactly as pamela/nancy and visitas6/visitas5? If you’d like, I can also help verify whether the table names should be pamela/nancy and visitas6/visitas5 before you test it. Best regards, Asad
$30 USD in 3 days
8.3
8.3

Hi, I can fix the MySQL query so it correctly matches the nombre + apellido pair, removes the #1241 error, and preserves the required ordering. I’m ready to start immediately.
$14 USD in 1 day
7.4
7.4

Hello its elementary task and I can complete it immediately, it's literally 10 minutes of work I have extensive experience with SQL and MySQL.
$10.21 USD in 1 day
7.2
7.2

Hello, I have 10 years of experience in database management and SQL optimization. I am confident in my ability to fix the MySQL query syntax for your project. The error you are encountering typically arises from incorrect subquery structure. I will provide a corrected SQL query using a proper JOIN to ensure accurate results. Additionally, I'll include a brief explanation of why the original query failed. I am ready to deliver a precise solution promptly. Regards, VishnuLal NB*
$100 USD in 1 day
7.4
7.4

Hi, I will fix syntax error. I am Wordpress,PHP programmer having 10 years of experience. I am very good in wordpress,php,mysql,joomla.
$30 USD in 1 day
7.4
7.4

As an experienced PHP developer with over a decade of expertise, I can fix your MySQL query and provide you with the perfect dataset you're in need of. I've worked extensively with MySQL and have solved similar issues in the past. In relation to your specific problem, it looks like the issue lies within the use of the "IN" operator where it is not appropriate. In this case, you need to use "EXISTS" instead of "IN". Additionally, understanding your request for no new indexes or performance tweaks, my optimized solution will adhere to that, ensuring faster execution without any adverse effect on the overall system performance. To sum up, hiring me gets you a seasoned professional capable of isolating and providing precise solutions to subtle coding issues like these. Perhaps it’s time to leverage my vast experience and take your project to greater heights.
$20 USD in 1 day
6.9
6.9

I can correct the MySQL query so it matches rows by the combined nombre/apellido pair and keeps the results ordered by especialidad1 ASC. The error occurs because `IN` is being used against a subquery that returns two columns, while the left side is not a matching two-column tuple
$30 USD in 1 day
6.2
6.2

Hi there, I can fix your MySQL query right away so it returns the exact dataset you need ordered by especialidad1 without throwing any errors. Why your original query failed: In MySQL, writing "WHERE nombre AND apellido IN (...)" treats "nombre" as an independent boolean condition. This leaves "apellido" as a single column trying to match against a subquery that returns two columns, which triggers the "#1241 – Operand should contain 1 column(s)" error. To fix this, the query needs to be restructured using proper row tuple comparison or a cleaner relational join structure, while ensuring the correct table names are referenced. I am available right now and can send over the corrected, ready-to-run SQL statement immediately upon hiring. Best regards, Palash Prosenjit Malakar
$10 USD in 7 days
6.4
6.4

Hello! I can fix this query quickly and explain exactly why you're getting the #1241 – Operand should contain 1 column(s) error. I'm a Senior SQL Developer & DBA with 10+ years of experience working with MySQL and SQL Server, writing and optimizing complex SQL queries, stored procedures, joins, and subqueries. For your query, I'll: - Rewrite it using the correct MySQL syntax (JOIN, EXISTS, or a multi-column comparison, depending on the best approach) - Ensure it returns only the matching `nombre + apellido` pairs from `visitas6` - Preserve the required output columns and `ORDER BY especialidad1 ASC` - Explain why the original query failed and how the corrected query works - Verify the results match your expected dataset This is a straightforward task, and I can deliver the corrected SQL promptly with a clear explanation. I can start immediately. Kind Regards, Shafir Senior SQL Developer & DBA Top Rated Freelancer (Top 3%)
$30 USD in 1 day
6.6
6.6

Hello, I can quickly rewrite and test your MySQL query to eliminate the #1241 error while returning exactly the required columns and matching (nombre, apellido) pairs correctly. I’ll use a clean JOIN or EXISTS approach, preserve the especialidad1 ASC ordering, and ensure there are no unnecessary changes to indexes or performance. I can deliver the corrected SQL with a brief explanation of the issue. Ready to fix it.
$20 USD in 1 day
6.4
6.4

Hi, I'm Denis, and I've worked with MySQL queries that involve complex joins and subqueries, especially in cases where data from one table needs to be filtered based on the presence of matching records in another. Your query fails because the `IN` clause expects a single column, but you're trying to match two columns (`nombre` and `apellido`) against a subquery that returns two columns. The correct approach is to use an `EXISTS` clause or a proper `JOIN` with a multi-column comparison. I'll rewrite the query to use `EXISTS`, which is efficient for this kind of filtering. This ensures only rows where `nombre + apellido` exists in `visitas5` are returned, ordered by `especialidad1`. I can start working right away. Let's connect and discuss the details. Thanks, Denis.
$10 USD in 1 day
6.1
6.1

Hi there, Give me dump of your database and I'll fix the query ASAP. Do not miss my bid, I'm not an autobidder. Thanks, Alex
$20 USD in 1 day
6.2
6.2

Hello Client, I will fix your query quickly. Looking forward to working with you. Regards, Manish
$20 USD in 1 day
5.8
5.8

Here is the working query SELECT nombre, apellido, especialidad1, especialidad2, categoria FROM pamela WHERE (nombre, apellido) IN (SELECT nombre, apellido FROM visitas6) ORDER BY especialidad1 ASC;
$20 USD in 7 days
5.8
5.8

Hi, I can fix this MySQL query cleanly by matching the nombre + apellido pair using EXISTS or a proper JOIN, while preserving the required especialidad1 ASC ordering. I’ll also verify the query returns exactly the requested columns without changing indexes or performance settings.
$10 USD in 1 day
5.5
5.5

Hi, I can help you with this project. I have relevant experience with PHP and can handle the work from development to testing and delivery. I've reviewed your requirements and can provide a clean, reliable, and responsive solution. Let's discuss the details and get started. Best, Arslan Shahid
$10 USD in 7 days
5.7
5.7

Hi, I’m interested in fixing your MySQL query and resolving the “#1241 – Operand should contain 1 column(s)” error. I hold a BSc in Computer Science and have experience with MySQL, SQL query development, database troubleshooting, and relational data handling. I understand that the requirement is to return `nombre`, `apellido`, `especialidad1`, `especialidad2`, and `categoria` while matching the `(nombre, apellido)` pair against the corresponding records in the second table and keeping the results ordered by `especialidad1 ASC`. I can provide a clean and reliable solution using a multi-column `IN`, `EXISTS`, or an appropriate `JOIN`, depending on the exact structure of your tables. I will also explain precisely why the original query produces the #1241 error. I’ll keep the solution focused strictly on the requested query correction, without introducing unnecessary indexes, performance changes, or unrelated modifications. I’m ready to review the query and provide the corrected SQL immediately. Thank you.
$20 USD in 2 days
5.8
5.8

I've built dozens of MySQL join conditions handling composite key lookups like this before, so this is straightforward. The original fails because `WHERE nombre and apellido IN (...)` tries to compare scalar columns against row tuples—MySQL expects single-column IN clauses, not multi-column pairs. I'll rewrite it using an INNER JOIN to match the (nombre, apellido) pairs from visitas5 against pamela, then filter and order as requested. The query will run cleanly without schema changes or performance tuning. Thanks, Andrii.
$20 USD in 1 day
5.2
5.2

You can send the sql file to check database. then, I will fix it soon. Best regards
$20 USD in 7 days
6.0
6.0

Tegucigalpa, Honduras
Payment method verified
Member since Mar 26, 2015
$10-30 USD
$10-30 USD
$30-250 USD
$30-250 USD
$10-30 USD
$750-1500 USD
$30-250 USD
$10-30 USD
₹1250-2500 INR / hour
₹750-1000 INR / hour
$250-750 USD
$10-30 USD
$250-750 USD
$250-750 USD
₹750-1250 INR / hour
₹500000-1000000 INR
$15-25 USD / hour
$250-750 CAD
₹12500-37500 INR
₹1500-12500 INR
₹12500-37500 INR
₹1500-12500 INR
₹750-1250 INR / hour
$30-250 USD
$250-750 CAD