P°φkaz DELETE (SQL)

p°φkaz_DELETE ::= DELETE FROM [schema.]jmΘno_tabulky [ WHERE podmφnka ]

Popis

P°φkaz DELETE vyma₧e zßznamy z danΘ tabulky. Nenφ-li pou₧ita omezujφcφ podmφnka, p°φkaz vyma₧e vÜechny zßznamy v tabulce, jinak se vyma₧ou pouze zßznamy podmφnce vyhovujφcφ.

P°φklad pou₧itφ

Vymazat zßznamy pat°φcφ do odd∞lenφ 1

DELETE FROM Zamestnan WHERE Oddeleni = 1

Vymazat zßznamy, kterΘ majφ hodnotu sloupce cislo v∞tÜφ ne₧ pr∙m∞rnΘ

DELETE FROM Tab3
 WHERE cislo > (SELECT Avg(cislo) FROM Tab3);