Groups | Blog | Home
all groups > sql server (alternate) > december 2004 >

sql server (alternate) : newbie join problem...


nib
12/20/2004 5:10:12 PM
[quoted text, click to view]

You at least have a unique index on warename, right? Otherwise you're
begging for bad data.

toedipper
12/20/2004 10:48:49 PM
Hello,

I have 2 tables, software and waretype.

The waretype table is a simple table with 2 fields wareid and warename

So the table looks like this

wareid warename
1 shareware
2 trialware
3 donationware
etc etc


The wareid field in above is unique.

The other table software simply contains details about software shock horror
but most importantly in this table I have one field call wareid which
represents the waretype of the app.

I can list the software table to my hearts content and see all the 1 and 2
and 3's that I want but what I really want to see is the waretype name. So
if in the software table the wareid is 1 then going by above example I would
like to see the name shareware, at the minute all I see is 1.

I am new to this and know that it has something to do with 'joins' but I
find it all a tad confusing.

Thanks,

td.





Erland Sommarskog
12/20/2004 11:01:38 PM
toedipper (send_rubbish_here734@hotmail.com) writes:
[quoted text, click to view]

SELECT s.col1, s.col2, ..., w.warename
FROM softweare s
JOIN warename w ON s.wareid = w.wareid


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
Pero Periæ
3/4/2005 5:46:54 PM
reterz675e7869780
[quoted text, click to view]

Pero Periæ
3/4/2005 5:47:46 PM
sorry.... I am lll
[quoted text, click to view]

Pero Periæ
3/4/2005 5:48:10 PM
ut
[quoted text, click to view]

NSpam
3/4/2005 5:58:18 PM
[quoted text, click to view]
Humm I think you need to get a crash course in database structures and
data analysis. If you can get the concepts then you won't have a
problem, trying to explain the "correct" way to do things is way too
complicated for newsgroup posts.
AddThis Social Bookmark Button