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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Select Distinct and Text field

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-02-18 : 23:52:34
Michael Collins writes "Do you know a way around the problem where you can't do a select distinct if one of the columns is a text datatype? I've found one article about using Union All, but it was confusing. Any help would be greatly appreciated.

-Mike"

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-02-19 : 13:04:54
Try converting it to a large VARCHAR() in your query.

i.e.,

CONVERT(Varchar(8000),TextField) as VarCharField



- Jeff
Go to Top of Page

ojn.
Starting Member

10 Posts

Posted - 2003-02-21 : 02:33:51
Here is a *workaround* demo...

select distinct pub_id,
substring(pr_info,1,8000),
substring(pr_info,8001,8000),
substring(pr_info,16001,8000)
from pubs..pub_info



--
-oj
www.rac4sql.net
Go to Top of Page
   

- Advertisement -