Question

J'ai une table de agaçants qui ne supprime pas et tient mon environnement dev rafraîchissement: (

Je sais que ce tableau existe. Exemple ...

mysql> select * from uc_order_products_qty_vw limit 10;
+-----+-------------+---------+---------+---------+---------+
| nid | order_count | avg_qty | sum_qty | max_qty | min_qty |
+-----+-------------+---------+---------+---------+---------+
| 105 |           1 |  1.0000 |       1 |       1 |       1 | 
| 110 |           5 |  1.0000 |       5 |       1 |       1 | 
| 111 |           1 |  1.0000 |       1 |       1 |       1 | 
| 113 |           5 |  1.0000 |       5 |       1 |       1 | 
| 114 |           1 |  1.0000 |       1 |       1 |       1 | 
| 115 |           1 |  1.0000 |       1 |       1 |       1 | 
| 117 |           2 |  1.0000 |       2 |       1 |       1 | 
| 119 |           3 |  1.3333 |       4 |       2 |       1 | 
| 190 |           5 |  1.0000 |       5 |       1 |       1 | 
| 199 |           2 |  1.0000 |       2 |       1 |       1 | 
+-----+-------------+---------+---------+---------+---------+
10 rows in set (0.00 sec)

Cependant, lorsque je tente de le laisser tomber ...

mysql> DROP TABLE IF EXISTS uc_order_products_qty_vw;
Query OK, 0 rows affected, 1 warning (0.00 sec)

Il ne fonctionne pas, la table est toujours là, et l'avertissement dit ceci ...

mysql> show warnings limit 1;
+-------+------+------------------------------------------+
| Level | Code | Message                                  |
+-------+------+------------------------------------------+
| Note  | 1051 | Unknown table 'uc_order_products_qty_vw' | 
+-------+------+------------------------------------------+
1 row in set (0.00 sec)

Se sentant assez abasourdi.

Était-ce utile?

La solution

A en juger par le nom qu'il pourrait être vue. Essayez d'utiliser DROP VIEW :

DROP VIEW uc_order_products_qty_vw

DROP TABLE ne fonctionne pas pour vues:

CREATE VIEW test_vw AS SELECT 1;
SELECT * FROM test_vw;    -- works
DROP TABLE test_vw;       -- error: Unknown table 'test_vw'
DROP VIEW test_vw;        -- works
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top