Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » Sql: *JoinRef
Sql: *JoinRef [message #34744] Fri, 09 December 2011 14:14 Go to previous message
mirek is currently offline  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'

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Settings and multiple ide instances
Next Topic: DataSource
Goto Forum:
  


Current Time: Tue May 14 09:44:01 CEST 2024

Total time taken to generate the page: 0.02496 seconds