Skip to content

Left Joins in relationships #1689

Answered by yorek
BumpaRoy asked this question in Q&A
Sep 6, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi BumpaRoy.

The left join is the default behavior, so you don't have to do anything specific for that. For example if you have the following database schema and data (I'm using Azure SQL or SQL Server in this sample):

drop table if exists dbo.Orders;
drop table if exists dbo.Customers;
go

create table dbo.Customers
(
    Id int identity(1,1) not null primary key,
    [Name] nvarchar(100) not null 
)
go
create table dbo.Orders
(
    Id int identity(1,1) not null primary key,
    CustomerId int null constraint FK_Orders_Customers foreign key references dbo.Customers(Id),
    Details nvarchar(100) not null
)
go

insert into dbo.Customers ([Name]) values ('Davide'), ('Ani'), ('Sean'), ('Jerry'

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BumpaRoy
Comment options

Answer selected by BumpaRoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants