-3
CREATE TABLE FUNCAO
(
ID_FUNCAO INT IDENTITY(1,1),
NOME_FUNCAO VARCHAR(100),
SALARIO VARCHAR(100),
DATA VARCHAR(100),
CONSTRAINT PK_FUNCAO PRIMARY KEY (ID_FUNCAO)
)
CREATE TABLE DEPARTAMENTO
(
ID_DEPARTAMENTO INT IDENTITY(1,1),
NOME_DEP VARCHAR(100),
ID_FUNCAO INT,
CONSTRAINT PK_DEP PRIMARY KEY (ID_DEPARTAMENTO),
CONSTRAINT PK_DEP_FUNCAO FOREIGN KEY (ID_FUNCAO)
REFERENCES FUNCAO (ID_FUNCAO)
)
In the VS Program the combobox Function and Salary The data come through the function table(did Inner Join)
I intend that on gridview date appear the two tables? only one appears. How to make two Inner Join in a select?
I’m using that select
string sql4A = "SELECT DP.ID_DEPARTAMENTO, DP.NOME_DEP, FUNCAO.NOME_FUNCAO, FUNCAO.ID_FUNCAO FROM DEPARTAMENTO AS DP INNER JOIN FUNCAO ON DP.ID_FUNCAO = FUNCAO.ID_FUNCAO";
"on gridview date appear the two tables? only one appears" That’s not clear, put the code in more detail. You wonder how to do two joins but only have two tables, only one Join already connects the two, which exactly wants to make you need to do another Join?
– Ricardo Pontual