Extract Columns for renaming

已回答

Does anyone know if there is a way to expand all the column names automatically from an query in phpStorm/DataGrip.

I have a query:

select g.*, s.*
from servicetemplategroups g
JOIN servicetemplates_to_servicetemplategroups s2stg on g.id = s2stg.servicetemplategroup_id
JOIN servicetemplates s on s2stg.servicetemplate_id = s.id

I basically want to prefix all my g.* and s.* columns therefore I need to create a statement 

g.id as servicetemplategroups_id,
g.name as servicetemplategroups_name
...

but I'm trying to avoid typing out all the columns (as there is a lot), I can then also easily remove any columns I don't need.

I'm hoping there is an expand function somewhere I missed (hopefully)

My database is MySQL (on a remote server).

Thanks in advance.

0

You can expand the column list by going behind the * and activating your context actions (Alt+Enter).

1

请先登录再写评论。