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.
Author |
Topic |
arjun_duddu
Starting Member
3 Posts |
Posted - 2011-12-31 : 11:45:47
|
Hello,I am working with joins, i have worked with SQL rather than SQL Server, observed that in the SQL 'Using' keyword would help in customizing joins, which would make a query Simple.I am unable to Customize the same query in SQL Server, Does SQL Server do not Support the 'Using' functionality? if it does how can i do it.Could anyone provide me the HELP needed in this. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
arjun_duddu
Starting Member
3 Posts |
Posted - 2011-12-31 : 12:10:31
|
Usage: The USING clause lists those attributes common to both tables that must have the same value to be in the result.Consider i have two tables1.Ingredients2.Vendors (Supplies the Ingredients)My Requirement:i want to retrieve the names supplied by a specific vendor:Sol :I can do this in following ways:1.select name,companynamefrom ingredients i,vendors vwhere i.vendorid = v.vendoridand v.companyname = 'Spring Water Supply'and Other Using 'Using'2.SELECT companyname, name, vendoridFROM ingredients JOIN vendors v USING (vendorid)WHERE v.companyname = 'Spring Water Supply';Note: Vendorid is common for both the tablesI am unable to work out with Second in SQL Server |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-12-31 : 14:43:08
|
SQL Server doesn't have a USING clause nor does it have natural joins.--Gail ShawSQL Server MVP |
 |
|
arjun_duddu
Starting Member
3 Posts |
Posted - 2012-01-01 : 02:11:40
|
ok, i was in a picture that, SqL Server Supports 'Using' keyword.Thank you for the Information. |
 |
|
|
|
|
|
|