I´m having the error #1241 in MySql when I try this syntax

UniX

I´m getting this error

1241 - Operand should contain 1 column(s)

when I try to select these two tables and columns.

I tried to remove the () from the select but that didn't work.

  SELECT (SELECT (SUM(preco_base),0)   FROM produtos) +
         (SELECT (SUM(salario_base),0) FROM salarios)
    FROM DUAL;
scaisEdge

sum() contanin a single operand sum(acol) not sum(col, 0)

You could try using a croos join

select a.sum_preco_base + b.sum_salario_base 
from (
 SELECT SUM(preco_base) sum_preco_base
  FROM produtos 
) a 
CROSS JOIN (
  SELECT (SUM(salario_base) sum_salario_base
  FROM salarios
) b 

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error when i try to opendir

I am having an error whenever I try to add this

Error 500 when I try to connect MySql with php's mysqli

I get a syntax error when I try to use array map function in Google Scripts. Why?

syntax Error in PostgreSQL when I try to create Trigger

Why did i get every time an Syntax error when i try to put an Variable in an Xpath

Having an SQL Error or I'm missing a syntax?

Syntax Error when I try to create trigger in mysql

CSS syntax error in CodeSandBox when i try to write code in a brakets

Why does MYSQL error when I try to add a foreign key?

Error when i try connect play with mysql 5.5

I'm getting this error when I try to delete a row

I'm having trouble with JavaScript syntax

Why do I get a syntax error when I try to print a nested hash that has keys containing colons?

I get this error when I try to install

Im having a run time Error type mismatch when i try to run sql

I'm new to using MYSQL and I'm having trouble locating my syntax error

I'm having an issue with this code when I try to input values into the transactions table

I'm having trouble understanding a syntax error in Python 3.7

When I try to run my application of submition data in SQLite there is an error 1 syntax error

I get a syntax error when I try to send a discord message

Is there a way to get rid of the syntax error when I run try and except?

Error #1064 MySQL when i try to insert register with my API

When ever I run MySQL query I get syntax error

NodeJS + Express: MySQL syntax error thrown but I cannot catch it on try-catch

When i try to delete a database it get a mysql error

I'm having a problem with and elseif statement saying syntax error

Syntax error near ARRAY when I try to execute a multiple update in python with psycopg2

Java is Throwing Syntax Error When I Try to Execute an SQL Query