Inserting a carriage return or new line in SQL code of a Query Table for readability

Inserting a carriage return or new line in SQL code of a Query Table for readability

My queries are working correctly, this is a formatting question to make it easier for me to see the structure of my queries when I am editing them.

In a SQL Query Table, the SELECT commands easily allow me to put each field on a new line by using the carriage return after the comma:

SELECT
     "Table 1"."Field Name 1" As "Alias Name 1",
     "Table 1"."Field Name 2" As "Alias Name 2",
     "Table 1"."Field Name 3" As "Alias Name 3",

etc.

all I had to do was hit "Enter" after the comma.  When I hit "Save" the carriage returns are saved just as they appeared in edit mode.

But later in the query in the FROM section, if I use a carriage return (without a comma because there is none in between the JOIN commands) it shows up properly when I am in edit mode:

FROM  "Table 1" LEFT JOIN "Table 2" ON "Table 2"."Field 1"  = "Table 1"."Field 1"
 LEFT JOIN "Table 3" ON "Table 3"."Field 1"  = "Table 1"."Field 1"
 LEFT JOIN "Table 4" ON "Table 4"."Field 1"  = "Table 1"."Field 1"

etc.

But when I hit save, this is how it is saved:

FROM  "Table 1" LEFT JOIN "Table 2" ON "Table 2"."Field 1"  = "Table 1"."Field 1" LEFT JOIN "Table 3" ON "Table 3"."Field 1"  = "Table 1"."Field 1" LEFT JOIN "Table 4" ON "Table 4"."Field 1"  = "Table 1"."Field 1"

i.e., no carriage returns, all on one very long line.  With many joins it becomes cumbersome to edit the SQL code or see the logic.

I saw references to "\n" in both MySQL docs and some postings in the forum, but inserting a \n after each join generates an error statement.

I am probably missing something simple here, but any clues would be much appreciated.

Thanks.
  

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • Announcing Zoho Analytics 6.0 Beta!

                                                We are delighted to open up the next major version, Zoho Analytics 6.0 Beta! The new version comes packed with a wide range of functionalities for all persona, namely business users, data analysts, data engineers, and data scientists. Zoho Analytics team
                                              • What's New in Zoho Analytics - August 2024

                                                Hello Users! We are back with the latest updates and enhancements made to Zoho Analytics. Keep reading to learn more about them. Connect to the data hosted in the cloud without allow-listing the IP addresses Utilize Zoho Databridge to connect to the data
                                              • We are coming to your city! Zoho Analytics Community Meetup

                                                Hello, business leaders and data enthusiasts! We are delighted to announce that registrations are now open for the ZUG meetups, and we can't wait for you to be a part of them. Our in-house analytics experts are geared up to lead discussions on constructing
                                              • Zoho Analytics: 2021 Look Back

                                                As we start a new year in 2022, here's some of our top moments from 2021. Zoho Analytics in 2021
                                              • [Customer Talk] PREMO Group's Analyst Interview at Zoho Day 2022

                                                Premo Group, a 50 year old Spanish Manufacturing Company, has been our long-standing customer with #ZohoAnalytics. They've been using our platform for their end-to-end, unified business analytics solution.  Hear more from Claudio Cabeza, Director at PREMO


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now