Right Align Part of the line
The challenge is to right align a part of the line - this is useful in some SQL queries where it's more clear which are the fields displayed
Start file
SELECT col1 AS column1, cast(column2 AS varchar(255)) AS column2, cast(evenlongercolumn3 AS varchar(255)) AS column3, cast(yetevenlongercolumn4 AS varchar(255)) AS column4, cast(thelongestcolumnyouhaveeverseen9 AS varchar(255)) AS column5, col1 AS column6, cast(column7 AS varchar(255)) AS column7, cast(evenlongercolumn8 AS varchar(255)) AS column8, cast(yetevenlongercolumn9 AS varchar(255)) AS column9, cast(thelongestcolumnyouhaveeverseen10 AS varchar(255)) AS column10 FROM table;
End file
SELECT col1 AS column1, cast(column2 AS varchar(255)) AS column2, cast(evenlongercolumn3 AS varchar(255)) AS column3, cast(yetevenlongercolumn4 AS varchar(255)) AS column4, cast(thelongestcolumnyouhaveeverseen9 AS varchar(255)) AS column5, col1 AS column6, cast(column7 AS varchar(255)) AS column7, cast(evenlongercolumn8 AS varchar(255)) AS column8, cast(yetevenlongercolumn9 AS varchar(255)) AS column9, cast(thelongestcolumnyouhaveeverseen10 AS varchar(255)) AS column10 FROM table;
View Diff
2,10c2,10 < col1 AS column1, < cast(column2 AS varchar(255)) AS column2, < cast(evenlongercolumn3 AS varchar(255)) AS column3, < cast(yetevenlongercolumn4 AS varchar(255)) AS column4, < cast(thelongestcolumnyouhaveeverseen9 AS varchar(255)) AS column5, < col1 AS column6, < cast(column7 AS varchar(255)) AS column7, < cast(evenlongercolumn8 AS varchar(255)) AS column8, < cast(yetevenlongercolumn9 AS varchar(255)) AS column9, --- > col1 AS column1, > cast(column2 AS varchar(255)) AS column2, > cast(evenlongercolumn3 AS varchar(255)) AS column3, > cast(yetevenlongercolumn4 AS varchar(255)) AS column4, > cast(thelongestcolumnyouhaveeverseen9 AS varchar(255)) AS column5, > col1 AS column6, > cast(column7 AS varchar(255)) AS column7, > cast(evenlongercolumn8 AS varchar(255)) AS column8, > cast(yetevenlongercolumn9 AS varchar(255)) AS column9,
Solutions by @Luoyb:
Unlock 2 remaining solutions by signing in and submitting your own entry