 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
crashman
Joined: 16 Oct 2009 Posts: 8 Country: Guatemala |
|
Change the side of JOIN |
|
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
 |
 |
select t1.a1, t2.a2
from TableA t1
Left Join TableB t2 on t2.ID = t1.ID
|
and i wish
 |
 |
select t1.Tb1
from TableA t1
Left join TableB t2 on t1.ID = t2.ID
|
[/code]
|
|
Mon Aug 08, 2011 2:12 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
crashman
Joined: 16 Oct 2009 Posts: 8 Country: Guatemala |
|
Thanks |
|
Thanks for the information...
|
|
Tue Aug 09, 2011 6:00 pm |
|
 |
eung
Joined: 18 Apr 2018 Posts: 2 Country: France |
|
Re UP |
|
Hi,
In the current version (9.5), the ordering is now customizable ?
Best Regards
|
|
Wed Apr 18, 2018 5:08 am |
|
 |
eung
Joined: 18 Apr 2018 Posts: 2 Country: France |
|
Info |
|
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 |
|
 |
|
|
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
|
|
|