Error creating MySQL view in phpMyAdmin

It's hard for me to create a view in phpMyAdmin. I have a database with a name myDBand a table with a name myTable.

In phpMyAdmin, I click on the SQL tab, type:

SHOW CREATE VIEW myView;

I got this error MySQLsaying:

#1146 - Table 'myTable.myView' doesn't exist

I don’t understand this error message at all, of course, it doesn’t exist, otherwise why do I want to create it first? And why do MySQLn't I create it? How to create a presentation?

thank

+4
source share
2 answers
SHOW CREATE VIEW

The syntax you use is not intended to create a view in SQL. it should show the views you created in SQL

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
+10

ALTER ALGORITHM = UNDEFINED DEFINER = **[YOUR_USERNAME]** @localhost VIEW **[YOUR_VIEW_NAME]** AS [YOUR_VIEW_QUERY];

, :

ALTER ALGORITHM = UNDEFINED DEFINER=`dadu_keeve`@`localhost` VIEW `view_banner` AS select `mst_banner`.`banner_uid` AS `banner_uid`,`mst_banner`.`banner_img` AS `banner_img`,`mst_banner`.`banner_alt` AS `banner_alt`,`mst_banner`.`banner_caption` AS `banner_caption`,`mst_banner`.`banner_link` AS `banner_link`,`mst_banner`.`banner_sort` AS `banner_sort`,`mst_banner`.`banner_tipe` AS `banner_tipe`,if((`mst_banner`.`banner_tipe` = 0),'BOX','FULL WIDTH') AS `banner_tipe_desc` from `mst_banner` ;
0

Source: https://habr.com/ru/post/1659193/


All Articles