SQLAlchemy join wtih tables creates on the fly

Viewed 48

I am having the following query:

select t2.col as tag, count(*)  
from my_table t1 JOIN TABLE(SPLIT(tags,'/')) as t2  
where t2.col != '' 
group by tag

(TABLE(SPLIT(tags,'/')) - create a temp table by splitting the tags field.)

Query works just fine running it on the database directly, but having trouble to create the query with this join clause using SQLAlchemy.

How can i perform a join with a table that created on the fly? and uses functions that aren't defined in SQLAlchemy.

Thanks.

0 Answers
Related