© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•12mo ago•
1 reply
tcurdt

insert from select

I am trying to convert a SQL query like this to drizzle:

INSERT INTO table_name (name)
SELECT
    name || ' (Copy)',
FROM table_name
WHERE id = 123;
INSERT INTO table_name (name)
SELECT
    name || ' (Copy)',
FROM table_name
WHERE id = 123;


but I really don't see how to do it without going for raw SQL.

Any pointers?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Infer insert model for select in "Insert into ... select"
Drizzle TeamDTDrizzle Team / help
15mo ago
Nested select in an insert
Drizzle TeamDTDrizzle Team / help
15mo ago
Insert returning api to match select columns
Drizzle TeamDTDrizzle Team / help
2y ago
Select without from?
Drizzle TeamDTDrizzle Team / help
15mo ago