I have a clientes table with columns:
nome
cidade
email1
email2
It's not all customers who have registered with email. How do I mount a sql statement where it only returns clients containing email1 or email2 ?...
Hello, I'm trying to add a foreign key to a table but I get error 1215. I've already checked the attributes and all are compatible, the wallet field is a primary key, I do not understand why it's not possible to add the key.
ALTER TABL...
In the following query I need the transaction_value to be considered 0 when it is NULL in the highlighted aggregation, how can it be done? I tried using it but it did not work
SELECT num_empenho AS EMP, data_empenho AS DATA, nome_fornecedor AS...
I find myself in the following picture situation
I need via sql to compare the value of the property with the minimum and maximum filter value but due to the semicolons I do not get results. How can I fix this?
I have a table with several columns, and I want to sort the results by the values of one of the columns where another column in the same table is equal to a value.
I have already tried to implement the query with CASE , IF's and...
I'm having a hard time putting together a select with GROUP BY . What I want to do is this:
I have three tables:
bicos
idbico, idempresa, idbomba
abastecimentos
idabastec, idbico, idempresa, valora...
It has a system that several companies use, but the changes in the bank tables are not informed.
I would like to create a select that would not return an error when it did not find a field recently taken from a table?
Code:
SELECT
c...
I have a PERSON table that has field A and B that form a UNIQUE .
I squeeze this select to return the name of the constraint :
SELECT DISTINCT COL.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS Tab, INFORMATION_SCHEMA...
Good afternoon, today a small question has arisen. Somewhere in my code I have a query to do an update.
The function is as follows:
function updateUser(user_id, params) {
const query = 'UPDATE users
SET user_name...
Hello, I have a situation in a system where I need to find out which student enrollments are related to a tutor in a class.
The tables I have are:
matricula containing foreign key with student (mat_aln_id) and with class (mat_tur_...