Groups | Blog | Home
all groups > sql server new users > january 2007 >

sql server new users : Select Query


Jim in Arizona
1/3/2007 11:27:53 AM
I'm trying to query rows from a column that is ntext. I want to remove
all those rows that are blank. These blank rows are just blank, not 'null'.

I can't use DISTINCT on a text or ntext column, as I found out.

I tried something like this:

select computers_comments
from survey06
WHERE computers_comments > ''

that just produces a syntax error, or course.

TIA,
Jim in Arizona
1/3/2007 11:31:37 AM
[quoted text, click to view]

I figured it out:

select computers_comments
from survey06
where computers_comments NOT LIKE ''

Roy Harvey
1/3/2007 1:53:48 PM
I don't see why the query you posted would produce a syntax error. It
did not produce one for me.

Roy Harvey
Beacon Falls, CT

On Wed, 03 Jan 2007 11:27:53 -0700, Jim in Arizona
[quoted text, click to view]
Jim in Arizona
1/3/2007 2:48:22 PM
[quoted text, click to view]

When I used this query:

select computers_comments
from survey06
WHERE computers_comments > ''

I got this error:

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

Roy Harvey
1/3/2007 5:55:26 PM
On Wed, 03 Jan 2007 14:48:22 -0700, Jim in Arizona
[quoted text, click to view]

Thanks, now I understand. I had not noticed the column type was
ntext, though you did say it was.

AddThis Social Bookmark Button