Re: SQL Join Woes

2011-02-01 Thread Aaron M Renfroe
Thank you! I will research the UNION Clause. You have been a great help! On Tue, Feb 1, 2011 at 3:13 PM, Ian Skinner wrote: > > On 2/1/2011 11:35 AM, Aaron M Renfroe wrote: > > On another note, the > > query that brought back 98 results may have been working right, i found > > another 78 record

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 11:35 AM, Aaron M Renfroe wrote: > On another note, the > query that brought back 98 results may have been working right, i found > another 78 records in another table for race car radiators, i'm almost > guessing that the last few are in another table that would make the total > 200 r

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 11:35 AM, Aaron M Renfroe wrote: > But i'm now getting an error that the part_number field > is ambiguous. Ugh That just means that the field is in both (multiple) tables and the database wants you to tell it which table you want to use to get the value for this column to use in

Re: SQL Join Woes

2011-02-01 Thread Aaron M Renfroe
I guess it could be both. While some part numbers can fit multiple years, makes, and models of a vehicle others just fit one. The top 200 are our best selling radiators. In theory, i want to hit the master table, pull out all the information on the radiator based on the part number being supplied

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 10:22 AM, Aaron Renfroe wrote: > Hello Ian and thank you! > > But my query was still running wrong, correct? Not necessarily, maybe your data is wrong. You may need to provide some more description on what data is in each of these tables and how you are trying to utilize it before

Re: SQL Join Woes

2011-02-01 Thread Aaron Renfroe
Hello Ian and thank you! I have tried both the left and right joins, the RIGHT join brought back the 15k results again, the LEFT join was bringing back so many that i killed the browser before it hurt something :) JOINS: SELECT * FROM GriffinDataRevised LEFT OUTER JOIN Top200 ON GriffinDa

Re: SQL Join Woes

2011-02-01 Thread Greg Morphis
a standard join looks like this.. select foo from a join b on a.id = b.id So yours would look something like SELECT PartNumber FROM GriffinDataRevised d JOIN Top200 t on d.partnumber = t.part_number You're not technically doing a join, you're doing a sub query. On Tue, Feb 1, 2011 at 11:41 AM

Re: SQL Join Woes

2011-02-01 Thread Ian Skinner
On 2/1/2011 9:41 AM, Aaron Renfroe wrote: > Hello All! > > SELECT DISTINCT PartNumber FROM GriffinDataRevised > INNER JOIN Top200 ON GriffinDataRevised.PartNumber = Top200.Part_Number > WHERE Top200.part_number = GriffinDataRevised.PartNumber INNER JOIN will enforce a filter tha

SQL Join Woes

2011-02-01 Thread Aaron Renfroe
Hello All! I'm trying my first Join of two tables and not having the best of luck... One table holds just a part number off our top 200 products, the second table holds a part number along with all the information that accompanies that part. I'm trying to pull back all the data from the inform