Hi
I need to make a INNER JOIN inside this statement how does I do that??
This is what I have tried so far?
When I send a e-mail to user I want to display Monday instead of 1, so thats why I have to INNER JOIN dage table.
CREATE TABLE [dbo].[ordre_linie] (
[ordre_linie_id] INT IDENTITY (1, 1) NOT NULL,
[antal] VARCHAR (50) NOT NULL,
[navn] VARCHAR (50) NOT NULL,
[fk_ordre_id] INT NOT NULL,
[fk_kurve_id] INT NOT NULL,
[total_pris] VARCHAR (50) NOT NULL,
[fk_dag_id] INT NOT NULL,
PRIMARY KEY CLUSTERED ([ordre_linie_id] ASC)
);
CREATE TABLE [dbo].[dage] (
[dag_id] INT IDENTITY (1, 1) NOT NULL,
[dag_navn] VARCHAR (50) NOT NULL,
PRIMARY KEY CLUSTERED ([dag_id] ASC)
);
cmd.CommandText = @"INSERT INTO ordre_linie (SELECT * FROM ordre_linie INNER JOIN dage ON ordre_linie.fk_dag_id = dage.dag_id)
(fk_ordre_id, navn, fk_kurve_id, antal, total_pris, fk_dag_id, dag_navn)
VALUES (@fk_ordre, @navn, @kurv, @antal, @pris, @dag, @dag_navn)";
Hope someone could help me
/Tina