0

I am completely new in SQL Alchemy. I am trying to convert below sql into sql alchemy but not getting desire result. My query:

select   locationkey
,(select geo.value from locations__geo_coordinates geo where l._id=geo._sdc_source_key__id and geo._sdc_level_0_id=0) as latitude
,(select geo.value from locations__geo_coordinates geo where l._id=geo._sdc_source_key__id and geo._sdc_level_0_id=1) as longitude 
from locations l

I am trying to get result by using session.query(. Whatever I found is on SELECT but that also giving error.

3
  • You should provide more information, maybe share your model definitions. Commented Mar 27, 2021 at 20:58
  • Perhaps this will be helpful: stackoverflow.com/a/43655840/6560549 Commented Mar 28, 2021 at 9:45
  • @SuperShoot Thnaks. It helped me. Commented Mar 30, 2021 at 10:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.