Question: SQL: Can someone help me rewrite this query to fix: ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause create view xxxxxxxxx
SQL: Can someone help me rewrite this query to fix: ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause
create view xxxxxxxxx as select p.name Project_name, CONCAT(s.fName,' ', s.lName) AS Staff_name, b.city Branch_city from dreamhome.Staff2 s inner join Branch b on s.branchNo = b.branchNo inner join Working w on s.staffNo = w.staffNo inner join Project p on w.pcode = p.pcode where s.staffNo in (select x.staffNo from (select w.staffNo, w.pcode, count(*) from Working w group by w.staffNo, w.pcode having count(*) > 1) x);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
