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 |
|
amitbarkai
Starting Member
19 Posts |
Posted - 2010-03-09 : 04:56:34
|
| Hey Allthis is a small part of my query SELECT DISTINCT ON (S.ID) AS StationID, ST.Value AS StationTypeName, R.ID AS RegionID, R.Value AS Region, A.ID AS AlertID, A.CreationDate, A.XMLDATA, <== problematic xml field A.LastUpdateDate,...doing so gives me the errorThe xml data type cannot be selected as DISTINCT because it is not comparable.which seems reasonable ,xml filed cannot be comapared does anyone knows away to skip a field while using Distinctnote* the xml is a mandatory and cannot be removed* for historical reasons we are using the xml field* i tried to convert the xml to nvarchar(max) and it works but i want to know if there's another waythanksAmit |
|
|
amitbarkai
Starting Member
19 Posts |
Posted - 2010-03-09 : 06:15:18
|
| i guessing i need to be more clear about my question :)let say your query return 2 fieldID Name ( the query doesn't matter for now )1 AAA1 AAA1 BBB1 DDDif we use distinct on the ID field the query will return1 AAA1 BBB1 CCCthe distinct will remove a dupplication of rowsmeaning it will comare the other fields as wellwhile one of the returned fields is an xml the distinct will not be possiblewhat i want to know if there a way to tell the sql server to skipon a specfic file (the xml field) |
 |
|
|
|
|
|