Question: I like SELECT *, but I don’t really want ALL the columns. Is there a better way?
Side Note: People are giving me crap on the ‘SPLAT’ – it’s perfectly acceptable! To me at least…
There’s a few better ways, and with an IDE like SQL Developer, you should expect lots of help in this area.
- drag and drop cols from the tree
- * expansion
- the Query Builder
- code insight
I have how-to’s on each of those methods. Here’s a quick video I made that shows all of them, using a SELECT * on EMPLOYEES and DEPARTMENTS.
This is the first time I tried a screen recording with QuickTime on the Mac…so no fancy editing or audio. I can do fancier if you’d like, but these are hopefully pretty simple to demonstrate, pick up.
BONUS! #5: Copy Selected Column Headers
The fans demanded I include this trick as well. So click here for another method – it involves copying column names from a grid.
6 Comments
Hi Jeff, in query result (table grid too) I can press Ctrl+A and then copy/paste content to Excel without Export, but column names are not copied. I am aware of “BONUS! #5” feature, but this way a delimited columns list is being copied, so in Excel I have to use Text to columns split to add column names. Using Export I have to save result to new file, open it, copy table, paste it into master workbook, delete export file. Takes time and it is pretty annoying when you need to copy lots of small tables. Is there or can there be in future something to speed copy/paste to Excel up? Thanks.
yeah, when you do your copy in the grid, do THIS instead – you’ll get the column headers too
It rocks! I can even select only some columns and it works perfectly. I wish I would have not missed THAT post years ago. Thank you.
Nah, YOU rock. I wish there were a way to make this more intuitive. Maybe we should make it a preference, but we have too many of those already.
Thanks for those tips!
You’re welcome!