Insert into

I

I M

INSERT INTO table1( Value1, Value2, Value3, Value4, Value5)
VALUES ((SELECT max(o.Id) FROM table2 As o), 11, 55, 66, 55);


this query throw error (No. -3025).
What's wrong?
 
G

Guest

You cannot have dots in field names in tables so Max(o.ID) is not valid. You
need to put the correct field name the item in table2, possibly just ID
max(ID) ......
 
D

David Lloyd

I would try something like this:

INSERT INTO Table1 (Value1, Value2, Value3, Value4, Value5)
SELECT max(o.Id), 11, 55, 66, 55
FROM Table2

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


INSERT INTO table1( Value1, Value2, Value3, Value4, Value5)
VALUES ((SELECT max(o.Id) FROM table2 As o), 11, 55, 66, 55);


this query throw error (No. -3025).
What's wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top