Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. INNER JOIN

INNER JOIN

Scheduled Pinned Locked Moved Database
databasehelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Syafiqah Zahirah
    wrote on last edited by
    #1

    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.id

    If 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 ..."

    L A 2 Replies Last reply
    0
    • S Syafiqah Zahirah

      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.id

      If 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 ..."

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      There is no "join" clause on the insert-statement. You'd insert the values you need, so I doubt you need to join any lookup-table in there.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      1 Reply Last reply
      0
      • S Syafiqah Zahirah

        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.id

        If 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 ..."

        A Offline
        A Offline
        Andrius Leonavicius
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups