Question
Thread display: Collapse - |
All Answers
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
help on joining two tables
I am new to SQL server.Working for SQL Server 2000.
I have two tables which are related twice
as my first table(master) is having a column named "KeyId" and
second table(child) is containing two columns AttrId ,Units# these two are foreign keys to the single column "KeyId" of first table(master).
I need to get the matching values of the two Columns from a single query which am unable to get.
The query which i used is
select Dic.AttrName as PropName, mat.AttrValue, mat.AttrMinValue, mat.AttrMaxValue,Dic.Category,Dic1.AttrName
from Materials mat, DictionaryTable Dic ,DictionaryTable Dic1
where mat.Rspec# =@p1 and
mat.Rev# =@p2 and
Dic.Category like @p3 and
mat.AttrId = Dic.KeyId and
mat.Units# = Dic1.KeyId
Pls suggest me a better approach how to join the two tables twice?...
thanks in advance..
shab