[Solved] No linebreak when using "between"

8 Posts
3 Users
0 Likes
244 Views
(@benjamin-moeller)
Member
Joined: 2 years ago
Posts: 13
Topic starter  

Hello
Is there a way to prevent a line break for the "and" in the "between" function? Otherwise, the AND should always be wrapped.


   
Quote
(@guidomarcel)
Member
Joined: 2 years ago
Posts: 9
 

Hi Benjamin. Thanks for your message. Could you please post an example. You are right  there should not be a linebreak.

Regards 

Guido


   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 168
 

@benjamin-moeller Hi, I am back from a weekend trip and tried to reproduce this behavior but was not able to add a linebreak before the AND keyword in the BETWEEN clause.

grafik

Did you maybe change the "page width" and by coincidence the AND was put on a new line because the max line length has been reached?

Regards

Guido

This post was modified 1 year ago 2 times by Guido

   
ReplyQuote
(@benjamin-moeller)
Member
Joined: 2 years ago
Posts: 13
Topic starter  

Hi Guido

i was able to reproduce it with an easy example. See the between in the second case statement.:

WITH base AS
           (
               SELECT
                         1  AS colum_1
                       , 2 AS column_2
                       , 3 AS column_3
                    FROM test
           )
SELECT
          column_1
        ,
          CASE
               WHEN column_1 = 1
               THEN
                    CASE
                         WHEN column_1 > column_2
                         THEN 3
                         ELSE 5
                    END
               WHEN coloum_1 BETWEEN 2
                    AND 3
               THEN 4
               ELSE 4
          END
     FROM base
     WHERE
          column_1 = 2
          AND column_1 BETWEEN 0 AND 1

   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 168
 

@benjamin-moeller ,

thanks for your example. This helped me to find the issue.

I fixed it and will publish the new release soon.

Are you working with the N++ plugin?

Regards

Guido


   
ReplyQuote
(@benjamin-moeller)
Member
Joined: 2 years ago
Posts: 13
Topic starter  

Hi Guido

super! That was fast!

Yes I am using the N++ plugin and the dbeaver plugin

 

Thanks

Ben


   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 168
 

@benjamin-moeller could you please download the newest N++ Plugin Release from here https://www.sqlinform.com/download-free-notepad-plugin/ and give it a try

 

grafik

 


   
ReplyQuote
(@benjamin-moeller)
Member
Joined: 2 years ago
Posts: 13
Topic starter  

Now it works like a charm


   
ReplyQuote
Share: