I have two table and I should write a select query which join this two table but I do not know what is conditional join between this two tables?
Can some body say what is?
TABLE ParameterRegistration
(
RegistrationTime DATETIME,
PatiNo VARCHAR(12),
Source VARCHAR(64),
Code VARCHAR(64),
NameOfCodingSystem VARCHAR(64) NULL,
Name VARCHAR(64),
ValueType CHAR(2) NULL,
NumericValue INT NULL,
StringValue VARCHAR(64) NULL,
TextValue TEXT NULL,
Unit VARCHAR(64) NULL,
UnitCode VARCHAR(64) NULL,
UnitCodingSystem VARCHAR(64) NULL,
Remark VARCHAR(255) NULL,
CreateDate DATETIME,
CreateUserId T_USER_ID
)
and
TABLE External
(
ModDate DATETIME,
ModUserId VARCHAR(12),
UbMem VARCHAR(64),
Code VARCHAR(64),
Name VARCHAR(64),
Service VARCHAR(64),
NameOfCodingSystem VARCHAR(64) NULL,
)
When joining tables you have to join on fields that are related. Since you did not provide a lot of information it looks like you have 3 fields that possibly could be joined on.
So you could technically write your query one of these ways:
OR
OR
OR you can join on all of the fields at the same time
My suggestion would be to study up on
JOINs. Here are some resources but there are plenty on the internet: