INNER JOIN
-
Hello..can anyone help me on this. I want to insert data based on the dropdownlist value. This is my database sql.
SELECT TOP (200) Actuators.id, Actuators.ActuatorInfo, Actuators.Fan, Actuators.Date, Actuators.DeviceId, Actuators.House, Actuators.DateView
FROM Actuators INNER JOIN TDevice ON Actuators.DeviceId = TDevice.id INNER JOIN TMushroomHouse ON TDevice.MushroomHouseId = TMushroomHouse.idIf I want to insert data DateView into table Actuators, based on the dropdownlist for mushroom house name, how I can inner join with table TDevice and TMushroomHouse. For example:"Insert into Actuators(DateView) Values (@DateView) INNER JOIN ..."
-
Hello..can anyone help me on this. I want to insert data based on the dropdownlist value. This is my database sql.
SELECT TOP (200) Actuators.id, Actuators.ActuatorInfo, Actuators.Fan, Actuators.Date, Actuators.DeviceId, Actuators.House, Actuators.DateView
FROM Actuators INNER JOIN TDevice ON Actuators.DeviceId = TDevice.id INNER JOIN TMushroomHouse ON TDevice.MushroomHouseId = TMushroomHouse.idIf I want to insert data DateView into table Actuators, based on the dropdownlist for mushroom house name, how I can inner join with table TDevice and TMushroomHouse. For example:"Insert into Actuators(DateView) Values (@DateView) INNER JOIN ..."
-
Hello..can anyone help me on this. I want to insert data based on the dropdownlist value. This is my database sql.
SELECT TOP (200) Actuators.id, Actuators.ActuatorInfo, Actuators.Fan, Actuators.Date, Actuators.DeviceId, Actuators.House, Actuators.DateView
FROM Actuators INNER JOIN TDevice ON Actuators.DeviceId = TDevice.id INNER JOIN TMushroomHouse ON TDevice.MushroomHouseId = TMushroomHouse.idIf I want to insert data DateView into table Actuators, based on the dropdownlist for mushroom house name, how I can inner join with table TDevice and TMushroomHouse. For example:"Insert into Actuators(DateView) Values (@DateView) INNER JOIN ..."
Hi, I don't understand what exactly you want to do, but there are two ways to insert data: 1. Insert values.
INSERT INTO Table1 (Column1, Column2)
VALUES (@Value1, @Value2);2. Insert from table/tables.
INSERT INTO Table1 (Column1, Column2)
SELECT Column1, Column2 FROM Table2
WHERE Column1 = @Parameter;or something like
INSERT INTO Table1 (Column1, Column2)
SELECT t2.Column1, t3.Column2 FROM Table2 AS t2
INNER JOIN Table3 AS t3 ON t2.ColumnID = t3.ColumnID
WHERE t2.Column1 = @Parameter;Best regards, Andrius Leonavicius