CREATE VIEW
USE practice
VIEW
)CREATE VIEW qry AS SELECT ac.id, ac.email, ac.nick, dt.district, af.affect FROM ac_basic ac
LEFT JOIN district_tw dt ON dt.id=ac.district
LEFT JOIN status_affect af ON af.id=ac.affect
ORDER BY ac.id;
SHOW TABLES;
SHOW FULL TABLES;
SHOW CREATE TABLE qry;
SHOW COLUMNS FROM qry;
PREPARE stmt FROM 'SELECT id, email, nick, district, affect FROM qry WHERE district LIKE ? ORDER BY id';
SET @q='%北%';
EXECUTE stmt USING @q;
DROP VIEW IF EXISTS qry;
更新日期: