cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Subquery does not work in Databricks Community version?

THIAM_HUATTAN
Valued Contributor

I am testing some SQL code based on the book SQL Cookbook Second Edition, available from https://downloads.yugabyte.com/marketing-assets/O-Reilly-SQL-Cookbook-2nd-Edition-Final.pdf

Based on Page 43, I am OK with the left join, as shown here:

imageHowever, when I try with subquery below, it fails, why?

image

2 REPLIES 2

Aviral-Bhardwaj
Esteemed Contributor III

it must have some github link check there or you cans hare your code and data we can help you

those 3 CSV files are uploaded here:

https://github.com/tanthiamhuat/SQLCookbook

below SQL code works when I work with SQL Server, but does not work in Databricks SQL.

select e.ename, d.loc,

(select eb.received from emp_bonus eb

where eb.empno=e.empno) as received

from emp e, dept d

where e.deptno=d.deptno

order by 2