Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 The ON Clause

Author  Topic 

DOlivastro
Starting Member

41 Posts

Posted - 2006-03-15 : 16:26:31
In Transact SQL, is it possible to have an automatic ON Clause? For example, is it possible to enter ...

FROM T_Test T
Left Join T_Redo R on ID

... in which the field "ID" is present in both tables.

jhermiz

3564 Posts

Posted - 2006-03-15 : 16:29:59
If ID is present in both tables you will need to specify which table you are referring to, so no.


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-03-15 : 16:35:26
Left Join T_Redo R on T.ID = R.ID

Tara Kizer
aka tduggan
Go to Top of Page

DOlivastro
Starting Member

41 Posts

Posted - 2006-03-15 : 16:35:52
I'll take your word for it, I guess you can't. But I want to be clear about what I'm asking. The full SQL looks like this:

From T_Test T
left join T_Redo R on T.ID = R.ID

In other words, "ON ID" is just a short hand way of saying "Join the fields ID from both tables." I'm fairly certain that some varieties of SQL have that, and it seems like an obvious addition. Am I wrong?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-03-15 : 16:39:33
T-SQL does not allow it.

Tara Kizer
aka tduggan
Go to Top of Page

jhermiz

3564 Posts

Posted - 2006-03-16 : 15:53:34
No one ever believes me :( sheesh!


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]

RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url]
Go to Top of Page
   

- Advertisement -