Re: I need a little SQL help
Quote:
Originally posted by dimava
Code:
SELECT distinct v.*,
[cUser].cEmail,
[oHRCurrent].ojSuperSSN as cSuperSSN,
[oHRCurrent].ojDivision as cDivision,
[oHRCurrent].ojDepartment as cDepartment
FROM [v_employee_list_names] v
JOIN [iMaster] ON v.[iKey]=[iMaster].[iKey]
JOIN [oHRBase] ON [iMaster].[iKey]=[oHRBase].[oKeyMaster]
JOIN [oHRCurrent] ON [oHRBase].[oKey]=[oHRCurrent].[oKeyBase]
JOIN [cUser] ON [iMaster].[iSSN]=[cUser].[cSSN] AND [cUser].[cKeyCompany]=v.[iKeyCompany]
WHERE v.[iKeyCompany]=1442
AND oHRCurrent.oPSID = 'FLX2'
AND v.[iKey] <> 0
ORDER BY v.[iName]
Can someone please explain what "v.*" means in the 1st line? Also what does the "v" mean in the FROM line?
[v_employee_list_names] is a view
this is for SQL Sever 2000
thanks
Dimava
"V" is the alias name of the object that has been specified in the FROM clause. Instead of using the long names for objects u can use there alias names.
The "v.*" in the first line means that the query maeans that all the columns in the object with alias name "v" and the alias name is specified in the FROM clause
Hope this is clarifying ur query. If not post here
Re: Re: I need a little SQL help
Quote:
Originally posted by cutamacious
"V" is the alias name of the object that has been specified in the FROM clause. Instead of using the long names for objects u can use there alias names.
The "v.*" in the first line means that the query maeans that all the columns in the object with alias name "v" and the alias name is specified in the FROM clause
Hope this is clarifying ur query. If not post here
so v is basically another name for that view?
Re: Re: Re: I need a little SQL help
Quote:
Originally posted by dimava
so v is basically another name for that view?
Yes, for accessing it using a simple name rather than a complicated name like one mentioned for the view, which may result in typing errors and hence may not execute