Solved

select into

Posted on 2011-03-21
3
222 Views
Last Modified: 2012-08-13
what would be the syntax to select from the same table and insert
the same id lets say id  377, but all storenumbers with the same id 377 within this one table.


select storenumbers from users1
insert into users1 (storenumbers , '377')
0
Comment
Question by:sevensnake77
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
this should do:

insert into users1 (storenumbers , id) 
select storenumbers , '377' 
from users1 

Open in new window

0
 
LVL 50

Expert Comment

by:Lowfatspread
Comment Utility
insert into users1 (id,storenumbers)
select distinct 377,storenumbers
from users1
0
 
LVL 9

Author Closing Comment

by:sevensnake77
Comment Utility
tks
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sql query 7 34
SQL server 2008 SP4 29 33
Access recordset not updateable 8 38
SQL Server issue connecting to named instance 6 41
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now