Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Create Table From Query Results

forums forums SQLyog SQLyog: Bugs / Feature Requests Create Table From Query Results

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #12478
      kenlyle2
      Member

      Hey, It would be good to have a command in SQLYog to Create Table from Query Results. Currently, in 9.3, I have to export , create a new table and import.

      Is there an easier way?

      Thanks,

      K

    • #32719
      peterlaursen
      Participant

      After executing a query, rigth-click in the result area, select “Export All Rows ..” and click “SQL” -option. This will save a .sql.file that can next be executed.

      But please read what the help file says about this option: “With this you can export any table and any resultset of any query. The purpose of this expose option is to provide a simple and fast way to export data embedded in SQL INSERT statements. With this tool you can also export data embedded in INSERT statements from a resultset from a query using a JOIN or UNION. However you should observe that if two or more JOINED tables have identically named columns the data will not import unless you use an ALIAS for at least one of them.Also a very simple 'CREATE STATEMENT for the TABLE' is created (if you choose), but this create statement is not a complete CREATE statements with all table and column options (such as Character Set and Storage Engine settings) and it should not be used for backup purposes.”

      Also you may simply execute “CREATE TABLE `new_table` as SELECT .. ;”

    • #32720
      kenlyle2
      Member
      'peterlaursen' wrote:

      After executing a query, rigth-click in the result area, select “Export All Rows ..” and click “SQL” -option. This will save a .sql.file that can next be executed.

      Very good, Thanks, and I note the warnings.

      'peterlaursen' wrote:

      Also you may simply execute “CREATE TABLE `new_table` as SELECT .. ;”

      Great! So I just get the SELECT working, then put CREATE TABLE `new_table` as in front? Nice.

      So that solves my issue, Thanks.

      Could you consider making this even easier for noobs, by adding CREATE TABLE as a right click option?

    • #32721
      peterlaursen
      Participant

      “Could you consider making this even easier for noobs, by adding CREATE TABLE as a right click option?”

      I have added this request here; http://code.google.com/p/sqlyog/issues/detail?id=99.

      I have not promised *if* and *when* we wll implement this!

    • #32722
      kenlyle2
      Member

      Thanks very much!

      Best,

      Ken

Viewing 4 reply threads
  • You must be logged in to reply to this topic.