CREATE VIEW v_employee AS (
SELECT * , taskcount = (SELECT COUNT(id) FROM t_task AS t WHERE t.eid = e.id) FROM t_employee AS e;
)
在mysql里创建视图失败 , sql语句应该怎么改
CREATE VIEW v_employee AS (
SELECT * , taskcount = (SELECT COUNT(id) FROM t_task AS t WHERE t.eid = e.id) FROM t_employee AS e;
)
在mysql里创建视图失败 , sql语句应该怎么改
CREATE VIEW v_employee AS (
SELECT * , taskcount = (SELECT COUNT(id) FROM test_task AS t WHERE t.eid = e.id) FROM test_employee AS e
)
[SQL]CREATE VIEW v_employee AS (
SELECT * , taskcount = (SELECT COUNT(id) FROM test_task AS t WHERE t.eid = e.id) FROM test_employee AS e
)
[Err] 1054 - Unknown column 'taskcount' in 'field list'