user3198428
user3198428

Reputation: 31

HeidiSQL - How to Select Individual Columns Explicitly into Query Window?

Apologies if title is unclear, couldn't think of a concise way to express this.

I'm wondering if HeidiSQL has some simple functionality to quickly create a new select query which explicitly lists every column contained in that table. In MS SQL Management Studio (And I believe also in MYSQL Workbench) this can be done just by right clicking the table and clicking 'New Select Query' or something along those lines.

This can be very useful for creating queries off tables containing many columns, where most but not all columns are desired, or where a handful of transformations are required. The alternative involves typing out every single column name individually. Creating a 'Create Table' query comes close to what I want, but includes all the column type descriptor information which needs to be manually deleted.

So for example what I want is, instead of:

SELECT *
FROM MyTable

I need:

SELECT ID,
   Name,
   Location,
   Date,
   Value1,
   Value2
FROM MyTable

Is there any quick and easy way to use the UI to generate this in HeidiSQL?

Upvotes: 3

Views: 8698

Answers (2)

Anse
Anse

Reputation: 1658

  1. Click the relevant table in the database tree
  2. Click on the Query tab
  3. Expand the Columns in <yourtable> node in the right helpers box
  4. Select wanted columns
  5. Right click, and click Generate SELECT...

Like in the following figure: enter image description here

Upvotes: 5

Lucas Panik
Lucas Panik

Reputation: 31

I had the same problem ...

Solved by installing an older version of HeidiSQL.

For older versions, show the complete "selects columns" in the log field.


Update 2015-03-18:

I get the full SELECT doing a simple update on any table field.

Image: http://pt-br.tinypic.com/view.php?pic=2nqtemr&s=8

Sorry for the my English, I don't speak English very nice, I'm from Brazil = /.

Upvotes: 0

Related Questions