Reputation: 2378
I am getting this error "Operand data type text is invalid for min operator" when trying to run this code
Select
UserID,
min(Description)
FROM Table1
GROUP BY UserID
I have tried
select min(cast(AttributeValue as varchar(max)))
But i couldnt get it working.
Is there any way around this? Thanks
Upvotes: 1
Views: 3568
Reputation: 918
Try This:
Select UserID,min(CAST(Description AS VARCHAR(50)))
FROM Table1
GROUP BY UserID
Upvotes: 2
Reputation: 5588
"Min" function not worked with "group by". So, please try with:
Select UserID
FROM Table1
GROUP BY UserID
Upvotes: 0