SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Change the side of JOIN

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Change the side of JOIN
Author Message
crashman



Joined: 16 Oct 2009
Posts: 8
Country: Guatemala

Post Change the side of JOIN Reply with quote
Hi, When use the Left Join in the query, the assistant show me the common columns, and thats great, but i wish to change the order

the assistant

Code:

select t1.a1, t2.a2
   from TableA t1
      Left Join TableB t2 on  t2.ID = t1.ID


and i wish

Code:

select t1.Tb1
   from TableA t1
      Left join TableB t2 on  t1.ID = t2.ID
[/code]
Mon Aug 08, 2011 2:12 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Reply with quote
Sorry, in the current version the ordering is not customizable.

Please note that SQL Assistant assumes classic SQL syntax that is supposed to be human readable (in English) with left to right reading order, in your example it is supposed to be like "join child table C where values in that table equal values in its parent table" If the SQL sentence is not human readable, please flip tables t1 and t2 in the FROM part to make it human readable.
Tue Aug 09, 2011 10:47 am View user's profile Send private message
crashman



Joined: 16 Oct 2009
Posts: 8
Country: Guatemala

Post Thanks Reply with quote
Thanks for the information...
Tue Aug 09, 2011 6:00 pm View user's profile Send private message
eung



Joined: 18 Apr 2018
Posts: 2
Country: France

Post Re UP Reply with quote
Hi,

In the current version (9.5), the ordering is now customizable ?

Best Regards
Wed Apr 18, 2018 5:08 am View user's profile Send private message
eung



Joined: 18 Apr 2018
Posts: 2
Country: France

Post Info Reply with quote
Into your pdf documentation
http://www.softtreetech.com/sqlassist/SqlAssist.pdf
page 376, your query contain what i want :

SELECT
p1.[name] AS [Role name],
CASE
WHEN p1.[type] = 'A' THEN 'Application Role'
ELSE 'Role'
END AS [Target type],
p2.[name] AS [Owner]
FROM sys.database_principals p1
LEFT JOIN sys.database_principals AS p2
ON p1.owning_principal_id = p2.principal_id

WHERE p1.is_fixed_role = 0
AND p1.principal_id <> 0
AND p1.[type] IN ('A', 'R')
ORDER BY p1.name
Wed Apr 18, 2018 5:54 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.