Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 INSERT Statements

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-12 : 09:04:34
John Kokado writes "I'm new here and somewhat new at SQL. I would appreciate any help somebody could offer me.

Here's my question:

How can I combine these 2 statements to insert records in a table (card_event) with values from a the select statement. g_card.id in Statement 1 is the value from statement 2.


Statement 1
insert into card_event
values ((select max(id) from card_event) +1, g_card.id ,"Printed: Bulk Mailing by CI","25-AUG-2001", 233,"25-AUG-2001",233,"PRINT", 0)

Statement 2
select g_card.id
from g_card
where type_id > 66

I hope this makes sense...

Thanks!"
   

- Advertisement -