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.toedipper (send_rubbish_here734@.hotmail.com) writes:
> 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.
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
http://www.microsoft.com/sql/techin.../2000/books.asp|||toedipper wrote:
> 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.
You at least have a unique index on warename, right? Otherwise you're
begging for bad data.
Zach|||reterz675e7869780
"toedipper" <send_rubbish_here734@.hotmail.com> wrote in message
news:32p367F3p51ddU1@.individual.net...
> 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.
>
>|||ut
"toedipper" <send_rubbish_here734@.hotmail.com> wrote in message
news:32p367F3p51ddU1@.individual.net...
> 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.
>
>|||sorry... I am lll
"toedipper" <send_rubbish_here734@.hotmail.com> wrote in message
news:32p367F3p51ddU1@.individual.net...
> 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.
>
>|||Pero Peri wrote:
> ut
> "toedipper" <send_rubbish_here734@.hotmail.com> wrote in message
> news:32p367F3p51ddU1@.individual.net...
>>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.
>>
>>
>>
>>
>>
>>
>
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.
No comments:
Post a Comment