I am putting together a proc, but depending on the value of a parameter, I would like the left join to be different.
I have tried the querys below:
This works, however, else as null or even else , if the parameter
COD_...
I created a dummy bank with the following structure:
BelowarealsothenumberedSQLServerscriptsforcreatingthedatabase,ifneeded. SQL Fiddle
Now, what I want is to make a query where they are shown:
The limit of an additional holder - pre...
I'm working with the following tables:
CREATE TABLE livro
( Id_livro int NOT NULL,
Nome_livro CHAR(40) NOT NULL,
Pg int,
Edicao int,
Editora int NOT NULL,
Assunto int NOT NULL,
Preco decimal (5,2) NOT...
I have the following query:
SELECT rp.colaborador as codigo_, t.nome, count(rp.*) as presencas,
((100 * (select count(rp.*) from empresa.cad_reuniao_presencas rp
join empresa.cad_terceiros t on t.codigo = rp.colaborador
join emp...
Sometimes I use the TDBLookupCombobox component to bring up a list of a dataset lookup field, this approach streamlines some things but is quite limited.
For example I have a list of stores in one TDBLookupCombobox and another a list of clien...
I have a X table that has my user's data, and I need to return data related to that user to the Y and Z table to the client.
I can do this using JOIN or:
SELECT attr1, attr2 FROM Y WHERE X_id = id
SELECT attr1, attr...
I've combined two tables with JOIN , the two tables have some columns with the same names ... When extracting data with PHP how will I differentiate?
Example :
foreach($dados as $values){
echo $values['price'];...
Is there a way to use WHERE to make a SELECT with INNER JOIN ?
My case is this:
SELECT CodCli, NomeCli
FROM tbvendas
INNER JOIN tbclientes
ON tbvendas.CodCli = tbclientes.AutoCod
I would like to put a WHER...
In Mysql I have the table usuario , with the fields ID and CPF :
IreceivedalistofsomeCPFsfromtheclientandwhatIneed:SeewhichoftheseusersisNOTintheusuario_gerenciamentotable,theproblemisthattheusuario_gerenciamentotabledoesn...
I would like to know how I can get values from a mysql database where the data obtained must be in one table and not in another.
For example: I want all equipment (table equipment) that is not reserved (table reservations)