0

Want to fetch data from two different queries since employee table is too large and emp dept would be always one . I am trying to avoid join with dept table instead trying to use below query

Want to convert below query to Eloquent query

SELECT ename, 
       (SELECT dname FROM dept WHERE dept.deptno=emp.deptno) dname 
FROM EMP

Laravel fetch data from two tables without join with pagination

Barmar
  • 741,623
  • 53
  • 500
  • 612
insoftservice
  • 820
  • 8
  • 15

1 Answers1

0

You could sue this code

SELECT ename, dname 
FROM EMP, dept
WHERE dept.deptno=emp.deptno

Y hope help you

Lamri Djamal
  • 236
  • 1
  • 10