on ‎2013 Sep 18 6:23 AM
Request clarification before answering.
hi all,
Is Freehand sql different from native sql?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Henry,
So we need to write sql's as we write in Oracle/sql server? By this systax changes for different databases?
Also can you please suggest on using the below bolded sql's with below table structures? For the above mentioned scenario.
emp ---------------> empId-empName-empSal-deptId
dept ---------------> deptId-deptName-deptMngr-deptHrId
hr ---------------> hrId-hrName
first find the numberr of entries by using this query
select d.deptId,d.deptName,d.deptMngr,h.hrName from dept d,hr h
where d.deptHrId=h.hrId
next depending upon the result
select
e.empId,e.empName,e.empSal,dh.deptName,dh.deptMngr,dh.hrName
from emp e, (select d.deptId,d.deptName,d.deptMngr,h.hrName from
dept d,hr h where d.deptHrId=h.hrId) dh
where e.deptId=dh.deptId
If we want using joins
select e.empId,e.empName,e.empSal,d.deptName,d.deptMngr,h.hrName
from emp e
inner join dept d on e.deptId=d.deptId
inner join hr h on h.hrId=d.deptHrId
TIA.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.