Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql/tsql/TSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -5120,6 +5120,7 @@ full_table_name
| database = id_ '.' schema = id_? '.'
| schema = id_ '.'
)? table = id_
| openquery
;

table_name
Expand Down
29 changes: 29 additions & 0 deletions sql/tsql/examples/openQuery_tableName.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

WITH abcd as(
SELECT
*
FROM OPENQUERY(mysqldg,'
select
* from abcd
') AS b
LEFT JOIN test.dbo.abcde AS p ON
b.inco=p.gco
),
plucount as(
select
j.loc,
COUNT(j.plu) as plucount
from jhdata as j
group by
j.loc
having
COUNT(j.plu)>1
)
select
*
from jhdata as a
inner join plucount as p on
a.loc=p.loc
order by
a.dept asc,
a.loc asc
Loading