Run into a design problem with a query. In the spirit of the season, I will describe the issue in an easy to understand example. Say I have a database based on the Indianapolis Colts football season. My main table is game information. (Week number) is the primary key. There are 17 entries. The many-to-many relationship is a table based on scoring.
(Week #) primary key
(Week Score ID) primary key
Week ID related to (Week #) in Main Table
Description of scoring play
I want to run a query that will pull up only the weeks that my Running Back scores a touchdown. If my running back scores 3 touchdowns in a game which would mean three entries in my second table, I only want my query to Indicate one week #.
This description seemed so easy at first...... Hopefully this is understandable, I think there is probably a very easy solution.
Thanks in advance
by the way, that is a horrible explanation of DISTINCT:
The SELECT keyword allows us to grab all information from a column (or columns) on a table. This, of course, necessarily mean that there will be redundencies. What if we only want to select each DISTINCT element? This is easy to accomplish in SQL.
SELECT does not necessarily mean there will be redundancies
"select each DISTINCT element" ???
no wonder we get people posting questions like
i have SELECT DISTINCT department, employee... but it doesn't work, it returns duplicated departments, i want to see the department only once!!!"