cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Multiple tables selection while using Freehand SQL

manna_das
Contributor
0 Likes
785

Dear All,

How to select multiple tables in Freehand Sql. I am not able to select multiple tables.

Kind Regards

Manna Das

View Entire Topic
Former Member
0 Likes

hi all,

Is Freehand sql different from native sql?

Henry_Banks
Product and Topic Expert
Product and Topic Expert
0 Likes

No. "freehand" just means it's the user that is typing the syntax in manually, rather than it being generated by a semantic layer (for example)

Former Member
0 Likes

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.