LMSouq
general-dev Open

INSERT with SELECT

KY
Kyle
1 month ago
3 views
Problem Description
I have a query that inserts using a `SELECT` statement: INSERT INTO courses (name, location, gid) SELECT name, location, gid FROM courses WHERE cid = $cid Is it possible to only select "name, location" for the insert, and set `gid` to something else in the query?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base