问题描述
大家好
我有一个表,其中有一个列"Usertype" .
在用户类型列中,有两个值("FREE","free").
我想根据用户类型分离那些记录.
就像
(1)从userinfo中选择,其中usertype ="FREE""
(2)从userinfo中选择,其中usertype =" free""
但是在这两种情况下,所有记录都来了.
任何人都可以帮忙找出将这些记录分开的确切查询.
如果能得到解决方案,我将不胜感激.
此致
Asutosha Sarangi
Hi All
I have a Table in which there is a column "Usertype".
In usertype column two values are there ("FREE","free").
I want to separate those records based on usertype.
like
(1) "select from userinfo where usertype=''FREE''"
(2) "select from userinfo where usertype=''free''"
But in both case all the records are coming.
Can anybody please help to find out what exact query should be to separate those records.
I will be thankful if I will get the solution.
Regards
Asutosha Sarangi
推荐答案
ALTER TABLE userinfo
ALTER COLUMN UserType VARCHAR(10)
COLLATE SQL_Latin1_General_CP1_CS_AS
select * from <table name=""> where (binary_checksum(Usertype) = binary_checksum('free'))</table>
希望对您有所帮助.
hope this helps.
这篇关于我的sql查询以过滤"FREE"和“免费"在表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!