SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 insert select
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pascal_jimi
Posting Yak Master

Azerbaijan
150 Posts

Posted - 10/08/2013 :  03:17:12  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
i have 3 table

a1
-----------------------
phone suret tarix kodprov
111 1024 2012.02.01 2


a2
----------------------
kodprov provayder

2 self



a3
----------------
phone suret tarix prov

how i make insert select to table a3

by example

a3
----------------------------------
phone suret tarix prov
111 1024 2012.02.01 self


http://sql-az.tr.gg/

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 10/08/2013 :  03:42:26  Show Profile  Reply with Quote

insert into a3 (phone, suret, tarix, prov)
select a1.phone, a1.suret, a1.tarix, a2.provayder
from   a1
       inner join a2 on a1.kodprov = a2.kodprov



KH
Time is always against us

Go to Top of Page

pascal_jimi
Posting Yak Master

Azerbaijan
150 Posts

Posted - 10/08/2013 :  03:53:51  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
thak you very much

http://sql-az.tr.gg/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 10/08/2013 :  05:28:43  Show Profile  Reply with Quote
suggest you to refer below link to get an idea of how joins work

http://www.w3schools.com/sql/sql_join.asp

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

pascal_jimi
Posting Yak Master

Azerbaijan
150 Posts

Posted - 10/08/2013 :  08:35:53  Show Profile  Visit pascal_jimi's Homepage  Reply with Quote
thank you very much visakh



http://sql-az.tr.gg/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000