c# - Joining two table into 1 table in SQL Server -
here have 2 tables. 1 called table1
, has column word
, of datatype varchar(500)
, looks like
a pen book nice .....
another table table2
, has column meaning
of datatype ntext
, looks
1 long lean object used writing reading material enjoy pleasant .......
now want bring together table1 , table2 , them create table table3
table3
have 2 columns word
, meaning
" column ,
a 1 pen long lean object used writing book reading material enjoy nice pleasant ..... .......
how can in sql server?
you improve have primary key column in table1 (lets phone call terms) , foreign key column in table2 (lets phone call definitions). can bring together both tables using these columns result
class="lang-sql prettyprint-override">select term, definition terms t left bring together definitions d on t.termid = d.termid
here sqlfiddle
imho there no need table3. utilize query desired result.
this way if need can store more 1 definition per term.
c# sql-server visual-studio-2010 join jointable
No comments:
Post a Comment