forums › forums › SQLyog › Using SQLyog › Saving Queries
- This topic is empty.
-
AuthorPosts
-
-
November 8, 2007 at 10:34 pm #10621tamsinrmMember
Hi,
I'm pretty new to MySQL, database analysis, etc. I was wondering if there is a way to save queries with SQLyog. In Access, you can essentially save a query as a new table. The only thing I've been able to figure out how to do so far with SQLyog is to export it to Excel and then import it back in as a new table. Is there a better solution?
Thanks!
Tamsin
-
November 9, 2007 at 8:59 am #25250peterlaursenParticipant
This is actually a MySQL question more than a SQLyog question!
In MySQL (like in most databases) such 'saved query' is called a VIEW!
The (most simple) SQL-syntax for creating a VIEW is
CREATE VIEW `viewname` {some SELECT statement}.
VIEWs are supported from MySQL 5.0.x. Once a VIEW is created you can query it like a table (with the restriction that not all VIEWs are updatable – refer to the MySQL documentation for details!)
In SQLog “CREATE VIEW” is in the database menu/context menu. We will soon add an option to generate a VIEW from the GUI Query Builder (Enterprise feature only). Also the option to query the VIEW will be added to the Query Builder.
-
November 9, 2007 at 4:12 pm #25251tamsinrmMember
Thanks for the answer. As you can tell, I'm pretty new to MySQL.
I'm currently using a trial version of the SQLyog Enterprise, mostly because I want the GUI Query Builder to help me as I learn the command line stuff. I'm thinking of purchasing the Enterprise version once the trial ends because the query builder has been incredibly useful. Any idea when you plan to add the additional VIEW options to the Enterprise version? I doubt that alone will determine whether I purchase the program. I've found it very useful so far for lots of other reasons!
peterlaursen wrote on Nov 9 2007, 03:59 AM:This is actually a MySQL question more than a SQLyog question!In MySQL (like in most databases) such 'saved query' is called a VIEW!
The (most simple) SQL-syntax for creating a VIEW is
CREATE VIEW `viewname` {some SELECT statement}.
VIEWs are supported from MySQL 5.0.x. Once a VIEW is created you can query it like a table (with the restriction that not all VIEWs are updatable – refer to the MySQL documentation for details!)
In SQLog “CREATE VIEW” is in the database menu/context menu. We will soon add an option to generate a VIEW from the GUI Query Builder (Enterprise feature only). Also the option to query the VIEW will be added to the Query Builder.
-
November 10, 2007 at 12:16 am #25252peterlaursenParticipant
“Any idea when you plan to add the additional VIEW options to the Enterprise version?”
I will ask the developer assigned with this for this detailed work-plan for the next months on Monday!
-
November 15, 2007 at 9:41 am #25253peterlaursenParticipant
Sorry for the delay.
I think in 3 weeks we will support VIEWS in Query Builder and Schema Designer.
-
-
AuthorPosts
- You must be logged in to reply to this topic.