Groups | Blog | Home
all groups > sql server (alternate) > september 2004 >

sql server (alternate) : Group by on the text colum throws error


aj70000 NO[at]SPAM hotmail.com
9/30/2004 9:38:43 AM
Hi ,

I have this query

paprojnumber is varchar
patx500 is text
palineitemseq is int

select Paprojnumber,Patx500,max(palineitemseq) from pa02101,pa01601
where
pa02101.pabillnoteidx=pa01601.pabillnoteidx group by
paprojnumber,patx500

it throws this error
Server: Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted,
except when using IS NULL or LIKE operator.

Thanks a lot for your help.

Ross Presser
9/30/2004 4:22:13 PM
[quoted text, click to view]

You can, however, group by an expression using it:

select Paprojnumber,Patx500,max(palineitemseq)
from pa02101,pa01601
where pa02101.pabillnoteidx=pa01601.pabillnoteidx
Robin Tucker
9/30/2004 6:24:58 PM
Here it means exactly what the error says. You cannot sort on a text field
(or NText field), which is what your "group by" code is trying to do.

[quoted text, click to view]

AddThis Social Bookmark Button