Showing posts with label examples. Show all posts
Showing posts with label examples. Show all posts

Friday, March 23, 2012

Joins

I am beginer and i am not clear about various joins in SQL Sever.I would like to know about various joins .If there is examples ,it will be very helpful

thanks

nevin

BOL (Books On Line) is your best friend.

Go in BOL and search for 'join' - you'll find all the information you need to begin with there.

/Kenneth

|||beside BOL, you can also take a look at
http://www.w3schools.com/sql/default.asp
http://www.sql-tutorial.net/
better still, buy a booksql

Friday, March 9, 2012

Join two tables of different database

Hi , let table a belongs to db1 and table b belongs to db2 . how can i join these two tables can any one give me examples... thanx in advance

Quote:

Originally Posted by krishnasarma

Hi , let table a belongs to db1 and table b belongs to db2 . how can i join these two tables can any one give me examples... thanx in advance


try:

select <field list>
from db1.dbo.tableA tbla
left/inner/right/full join db2.dbo.tablB tblb on tbla.linkfiend = tblb.linkfield

dependeing on your requirement, you can choose whether it's a left, inner , full or right outer join. you might also need analyze what field to use to link the two tables