Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 01:56 PM
jkandiko
Guest
 
Posts: n/a
Default Advanced query help

Hello all,


I have a database with projects and locations. A project can be in
more than one location. So the table looks like this.

1 Burundi
1 Oklahoma
2 Kansas
3 Brazil


What I want to create is a query that only lists the projectid once,
and then has another field that gets filled with all of the locations
for that project. Right now I return a row for each combination of
projectid with a location. I just need a column that is the
culmination of the locations. Can somebody point me in the right
direction?

Thanks
Josh
  #2  
Old June 14th, 2006, 10:26 AM
Newbie
 
Join Date: Jun 2006
Posts: 1
Default

Hi Josh
I think what you are getting is known as the cartesian product, i.e all possible combinations.
You need to put the word DISTINCT in your select statement.
Hope this helps.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,174 network members.