Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert into problem

Status
Not open for further replies.

Barrow66

Programmer
Sep 3, 2002
37
US
Insert into problem

I have information in table variable as:
Table1
Location Letter Amount
12 A 0
12 B 0
12 C 1

The information above placed in another table variable must look like:
Table 2
Location Letter Amount
12 A 1
12 B 1
12 C 1
The reason behind the result is to insert records into table 2 from table 1 within the same location that have both letter A and letter B amount = 0.

Can someone help?
Thanks in advance
 
insert TableB
select
location,
letter,
case when amount = 0 then 1 else amount end
from TableA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top