pub enum JoinType {
Inner,
Left,
Right,
Full,
LeftSemi,
RightSemi,
LeftAnti,
RightAnti,
LeftMark,
}
Expand description
Join type
Variants§
Inner
Inner Join - Returns only rows where there is a matching value in both tables based on the join condition. For example, if joining table A and B on A.id = B.id, only rows where A.id equals B.id will be included. All columns from both tables are returned for the matching rows. Non-matching rows are excluded entirely.
Left
Left Join - Returns all rows from the left table and matching rows from the right table. If no match, NULL values are returned for columns from the right table.
Right
Right Join - Returns all rows from the right table and matching rows from the left table. If no match, NULL values are returned for columns from the left table.
Full
Full Join (also called Full Outer Join) - Returns all rows from both tables, matching rows where possible. When a row from either table has no match in the other table, the missing columns are filled with NULL values. For example, if table A has row X with no match in table B, the result will contain row X with NULL values for all of table B’s columns. This join type preserves all records from both tables, making it useful when you need to see all data regardless of matches.
LeftSemi
Left Semi Join - Returns rows from the left table that have matching rows in the right table. Only columns from the left table are returned.
RightSemi
Right Semi Join - Returns rows from the right table that have matching rows in the left table. Only columns from the right table are returned.
LeftAnti
Left Anti Join - Returns rows from the left table that do not have a matching row in the right table.
RightAnti
Right Anti Join - Returns rows from the right table that do not have a matching row in the left table.
LeftMark
Left Mark join
Returns one record for each record from the left input. The output contains an additional column “mark” which is true if there is at least one match in the right input where the join condition evaluates to true. Otherwise, the mark column is false. For more details see 1. This join type is used to decorrelate EXISTS subqueries used inside disjunctive predicates.
Note: This we currently do not implement the full null semantics for the mark join described in 1 which will be needed if we and ANY subqueries. In our version the mark column will only be true for had a match and false when no match was found, never null.
Implementations§
Trait Implementations§
Source§impl PartialOrd for JoinType
impl PartialOrd for JoinType
impl Copy for JoinType
impl Eq for JoinType
impl StructuralPartialEq for JoinType
Auto Trait Implementations§
impl Freeze for JoinType
impl RefUnwindSafe for JoinType
impl Send for JoinType
impl Sync for JoinType
impl Unpin for JoinType
impl UnwindSafe for JoinType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more