Switch column within 2 tables

Discussion of issues, suggestions and bugs of Devart Excel Add-ins, our product line for connecting Excel to external data from cloud applications and databases
Post Reply
KPM
Posts: 1
Joined: Thu 20 Aug 2020 23:32

Switch column within 2 tables

Post by KPM » Fri 21 Aug 2020 00:01

HI,

Here my SQL Query lines code :

SELECT t.Id,
t.Name,
t."État du locataire",
OrganizationId.Name AS "OrganizationId.Name"
FROM User AS t
LEFT OUTER JOIN Organization AS OrganizationId ON t.OrganizationId = OrganizationId.Id

I would like to see the column Organizationid.Name after the t.Name as third column and not the last one

Thanks

AlexBrown
Posts: 3
Joined: Wed 06 Jun 2018 11:02
Contact:

Re: Switch column within 2 tables

Post by AlexBrown » Fri 04 Sep 2020 08:15

Many thanks for the guide! Worked for me perfectly!

dm-m
Devart Team
Posts: 3
Joined: Tue 06 Aug 2019 07:43

Re: Switch column within 2 tables

Post by dm-m » Wed 09 Sep 2020 05:03

KPM wrote:
Fri 21 Aug 2020 00:01
HI,

Here my SQL Query lines code :

SELECT t.Id,
t.Name,
t."État du locataire",
OrganizationId.Name AS "OrganizationId.Name"
FROM User AS t
LEFT OUTER JOIN Organization AS OrganizationId ON t.OrganizationId = OrganizationId.Id

I would like to see the column Organizationid.Name after the t.Name as third column and not the last one

Thanks
Hello,

Thank you for contacting us!

To change the order you can set the required column right after t.Name in your query. Here is what it will look like:

Code: Select all

SELECT t.Id, 
       t.Name, 
       OrganizationId.Name AS "OrganizationId.Name",
       t."État du locataire"
FROM User AS t
LEFT OUTER JOIN Organization AS OrganizationId ON t.OrganizationId = OrganizationId.Id
Should you have any questions, do not hesitate to contact us back.

Post Reply