Home » Community » U++ community news and announcements » Sql: New 'Of' 'syntax'
Re: Sql: New 'Of' 'syntax' [message #34639 is a reply to message #34611] |
Fri, 02 December 2011 20:21   |
|
mirek wrote on Thu, 01 December 2011 18:20 | Recently I have found I am doing a lot of joins in SQL, which leats to pretty verbose 'syntax' to get columns in Select list:
Select(ID.Of(FOO), NAME.Of(FOO), SURNAME.Of(FOO),
ID.Of(BAR), CODE.Of(BAR)).From(FOO).InnerJoin(BAR)...
after some thinking, I have introduced 'group synonym' for Of via function call, so now we can write:
Select(FOO(ID, NAME, SURNAME), BAR(ID, CODE)).From(FOO).InnerJoin(BAR)...
|
That's really cool. In one of my apps I simply generated ids that started with table shortcut. For PERSON table I've got:
PE_NAME, PE_AGE and so on. Disadvantage was too many global id objects.
|
|
|
Goto Forum:
Current Time: Sun Jul 20 00:48:15 CEST 2025
Total time taken to generate the page: 0.03137 seconds
|