Copying field names

jlcox

Member³
Maybe there's something I'm overlooking here, but suppose I have a query like

select a.field1, b.field2, a.field3, a.field4
from a, b where a.id = b.id

and I want to use this as a subselect for this query:

select field1, field2, field3, field4
from (select a.field1, b.field2, a.field3, a.field4
from a, b where a.id = b.id
)

The question is: is there an easy way to copy the field names from the original query to help create the full query? The current way I'm doing it is to go to single record view, highlight the field names in the leftmost column, copy, then paste them back into the SQL window and manually add the commas. Seems like there should be some sort of context menu choice for this.
 
select *
from (select a.f1, b.f1, a.f4 from a, b where a.id = b.id)

or

get AutoHotkey and use this macro

;------------------------------------
#,:: ; make separated list from clipboard contents (choose separator)
inputbox, new_delim, Replace CRLF with a new character, New character, nohide, , 110, , , , , `,
if not errorlevel
stringreplace clipboard, clipboard, `r`n, %new_delim% , all
return
 
Back
Top