forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Create Table From Query Results
- This topic is empty.
-
AuthorPosts
-
-
October 15, 2011 at 3:43 am #12478kenlyle2Member
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
-
October 15, 2011 at 7:57 am #32719peterlaursenParticipant
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 .. ;”
-
October 15, 2011 at 1:03 pm #32720kenlyle2Member'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?
-
October 15, 2011 at 5:47 pm #32721peterlaursenParticipant
“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!
-
October 15, 2011 at 6:40 pm #32722kenlyle2Member
Thanks very much!
Best,
Ken
-
-
AuthorPosts
- You must be logged in to reply to this topic.