2 tabele – Cum adaugam o coloana intre 2 coloane

November 10, 2009

Sa presupunem ca avem 2 tabele numite Table1 si Table2 cu urmatoarea structura:

Continut tabela1 numita Table1:


Continut tabela2 numita Table2:


Dorim sa obtinem urmatorul output:


Pentru aceasta vom realiza interogarea:

SELECT Table1.Id, Table1.Name, Table2.Age, Table2.Sex

FROM Table1
INNER JOIN Table2 ON (Table1.Id = Table2.Id)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: