I have a Query where I give a select with INNER JOIN between two tables (contacts and company) I have a field called business_id where I search the business table to find the business name, but the business_id field is not required, so you...
I'm trying to get the ID of a bank data with PHP. At the time of returning the value, it always comes as 1.
//Obtenho os valores por GET
$description = $_GET['DESC'];
$contentType = $_GET['TYPE'];
$content = $_GET['CONT'];
//Crio meu objeto d...
I have a question, is it possible to add variables in a column?
Test Code
var sql = "INSERT INTO sometable (someparam) VALUES (varToParam)";
con.query(sql, function (err, result) {
if (err) throw err;
console.log("test");
});...
Hello everyone, I created a maven project in eclipse (with WAR packaging) and I imported the packages of models already mapped from another project, I then created a class to "load" a factory of persistence but it returns the following error:...
I have a media table with the fields id_midia , nome , tipo , and another synonymous table that has the id_midia , sinônimo
I need to make a query where it checks the two tables whether the term you typed is co...
Example:
select 'a' as 'letras', 'b' as 'letras'
I want to play the letter 'a' and the letter 'b' in the column 'letters', but with this code it returns 2 columns with the same name, but I want to play the values in the same column and I do...
I have tried a few tutorials but I do not think there is any expectation on how to declare the variable in select by MySQL,
DECLARE @idPedido INT;
DECLARE @idCombo INT;
SELECT @idPedido = idPedido, @idCombo = idCombo
FROM Pedidos
WHERE idC...
Below is the structure and relationships of my database.
I tried to use the code:
'SELECT 'cliente'.'Nome', 'produto'.'Descricao',
'contem'.'QuantItem'
FROM 'cliente', 'produto', 'contem'
INNER JOIN 'pedido'
ON 'cliente'.'Codigo' =...
I have the following SELECT:
SET @peso := 0;
SET @ganho := 0;
SELECT
@peso := (SELECT SUM(peso)/1000 FROM entrada WHERE entrada_id = A.entrada_id)+@ganho AS peso,
@peso,
@ganho := (SELECT SUM(ganho)/1000 FROM entrada WHERE entrada...
I have a table, and I looped for it to receive input and also to do insert, however I'm having problems in INSERT and UPDATE . Where I have two codigo_tipo , descricao fields that are always inserted together int...