Page 1 of 1

Switch column within 2 tables

Posted: Fri 21 Aug 2020 00:01
by KPM
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

Re: Switch column within 2 tables

Posted: Fri 04 Sep 2020 08:15
by AlexBrown
Many thanks for the guide! Worked for me perfectly!

Re: Switch column within 2 tables

Posted: Wed 09 Sep 2020 05:03
by dm-m
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.