What is the Vi editor regex for this? -


i have lot of columns in table. want replace in query:

select count(distinct a), count(distinct b), count(distinct c), count(distinct d) table_name; 

to reflect aliases:

select count(distinct a) a, count(distinct b) b, count(distinct c) c, count(distinct d) d table_name; 

try this:

s/\vdistinct\s(.{1})\)/distinct \1) \1/g 

you gotta put \v @ beginning use groups.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -