Home » Community » U++ community news and announcements » Sql: *JoinRef
Sql: *JoinRef [message #34744] |
Fri, 09 December 2011 14:14 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
It took some time and effort, but SqlExp is now able to create join conditions based on .sch file REFERENCES and PRIMARY_KEY attributes:
Select(ID(ID, NAME, LASTNAME))
.From(TABLE1).LeftJoinRef(TABLE2)
.Where(BDATE == Date(2011, 12, 9))
produces
select ID.ID, ID.NAME, ID.LASTNAME
from TABLE1 left outer join TABLE2 on TABLE2.TABLE1_ID = TABLE1.NAME
where BDATE = date '2011-12-09'
it is also possible to use On clause anyway - it gets combined with 'and':
Select(ID(ID, NAME, LASTNAME))
.From(TABLE1).LeftJoinRef(TABLE2).On(IsNull(BDATE))
.Where(BDATE == Date(2011, 12, 9))
select ID.ID, ID.NAME, ID.LASTNAME
from TABLE1 left outer join TABLE2 on TABLE2.TABLE1_ID = TABLE1.NAME and BDATE is NULL
where BDATE = date '2011-12-09'
|
|
|
|
|
Sql: *JoinRef
By: mirek on Fri, 09 December 2011 14:14
|
|
|
Re: Sql: *JoinRef
By: Didier on Thu, 22 December 2011 00:22
|
|
|
Re: Sql: *JoinRef
By: mirek on Thu, 22 December 2011 08:17
|
|
|
Re: Sql: *JoinRef
By: Didier on Thu, 22 December 2011 17:26
|
|
|
Re: Sql: *JoinRef
By: Didier on Thu, 22 December 2011 23:10
|
|
|
Re: Sql: *JoinRef
By: mirek on Fri, 23 December 2011 08:40
|
|
|
Re: Sql: *JoinRef
By: mirek on Fri, 23 December 2011 08:48
|
|
|
Re: Sql: *JoinRef
By: Didier on Fri, 23 December 2011 17:24
|
|
|
Re: Sql: *JoinRef
By: mirek on Fri, 23 December 2011 17:26
|
|
|
Re: Sql: *JoinRef
By: mirek on Fri, 10 February 2012 19:12
|
|
|
Re: Sql: *JoinRef
By: Didier on Sat, 11 February 2012 09:31
|
Goto Forum:
Current Time: Tue May 14 09:44:01 CEST 2024
Total time taken to generate the page: 0.02496 seconds
|