Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
flyadvertising
Starting Member
2 Posts |
Posted - 2011-02-06 : 01:14:39
|
| The following is working great, but I need to get one more row from the second table (ppics). However, when I try to add this in, my query stops working. Any help will be much appreciated.SELECT ppre.cID, ppre.yr, ppre.make, ppre.model, ppre.vin, ppre.display FROM ppreJOIN (SELECT DISTINCT pcID FROM ppics) AS TR ON TR.pcID = ppre.cID |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2011-02-06 : 07:25:58
|
You need one more ROW from the 2nd table?are you saying you need more DISTINCT pcID's ?What do you mean "Stops working"? Poor planning on your part does not constitute an emergency on my part. |
 |
|
|
flyadvertising
Starting Member
2 Posts |
Posted - 2011-02-06 : 21:06:45
|
| Sorry, I meant 1 more COLUMN, ppics.purl. This should not pull all of the distinct values in ppics.purl, rather just the ppics.purl that is associated with the ppics.pcID.By "stops working", I mean when I try to pull in this column, I lose the filtering of the distinct pcID and I see the entire database displayed. |
 |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2011-02-07 : 08:47:30
|
| What are you expecting? How can you have distinct IDs if each ID can have multiple purl ? What you are asking for makes no sense:pcID purl1 abc2 def2 ghi3 jklwhat would you expect to see differently if you select DISTINCT rows? |
 |
|
|
|
|
|
|
|