Hi,
I'm trying to use a VALUES statement in a CTE, and I can't figure out the
correct SQLAlchemy constructs to make this happen. I'd appreciate any help.
Here's the SQL I'd like to express in SQLAlchemy --
WITH knights(name, favorite_color) AS (
VALUES
('Lancelot', 'blue'),
('Galahad', 'blue. no, yellow')
),
SELECT my_table.*, favorite_color
FROM my_table
JOIN knights USING (name)
Ideally, I would like to be able to express this as a Query that I can later
execute or pass to an insert().from_select(columns, my_query).
The backend is Postgres 11, and our SQLAlchemy version is 1.3.
Thanks
Philip
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/E6CA442E-CB28-431B-9056-61144A9838D2%40americanefficient.com.