
June 23rd, 2004, 05:51 PM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 19
Time spent in forums: 8 h 11 m 26 sec
Reputation Power: 0
|
|
Select distinct with text datatype
Here is the code I'm trying to execute.
SELECT DISTINCT Projects.PID, Projects.P_Name, Projects.P_Overview, Projects.P_Due_Date, Projects.P_Start_Date, Projects.P_Complete_Date, Projects.P_LastMod_Date, Users_2.UID, Users_2.F_Name, Users_2.L_Name FROM Users INNER JOIN Projects_Team ON Users.UID = Projects_Team.PT_Users_FK RIGHT OUTER JOIN Projects ON Projects_Team.PT_Projects_FK = Projects.PID LEFT OUTER JOIN Users Users_2 ON Projects.P_LastMod_By_FK = Users_2.UID LEFT OUTER JOIN Users Users_1 ON Projects.P_Created_By_FK = Users_1.UID;
Obviously this query has multiple joins. The problem I'm having is that P_Overview is a text field, so obviously it won't work. The PID field is the primary key for this query, and I just want to eliminate duplicate PID records.
I saw in another thread, someone had suggested placing the text field in it's own table and referencing it using a foreign key. How would this be done? Wouldn't it still be pulled into the "select distinct" statement? Any help would be much appreciated. This is for an ASP 3.0 application.
|