Forum Discussion
dbfestivalopera
Nov 30, 2023Copper Contributor
INSERT Multiuple Rows Not Working
I have a query (executed from a macro) as follows: INSERT INTO PatronsWork (PatronID) SELECT DISTINCT EventAttendance.PatronID FROM EventAttendance; I get nothing inserted. If I remove the...
dbfestivalopera
Dec 01, 2023Copper Contributor
Thanks to all who responded. The SQL I posted is actually a fairly minimal reduction of what I'm really trying to do (which involves multiple subqueries, joins, temp variables and more). The example posted was paired down to a minimum statement to illustrate the problem. I was hoping to avoid having to use VBA (which I'm not very experienced in), but maybe that's the only workable solution.
By the way, I also go no joy from the following:
SELECT EventAttendance.PatronID
INTO BrandNewTable
FROM EventAttendance;
I've never used a SELECT.INTO statement before, but it looks simple enough. However, I get no new table produced in executing the above. Could this be related?
By the way, I also go no joy from the following:
SELECT EventAttendance.PatronID
INTO BrandNewTable
FROM EventAttendance;
I've never used a SELECT.INTO statement before, but it looks simple enough. However, I get no new table produced in executing the above. Could this be related?
peiyezhu
Dec 02, 2023Bronze Contributor
please provide some DDL(Data Definition Language) or some data and your expected result.
Both sqls you metioned all work well on my side.