最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

mysql varchar 查詢問(wèn)題 ?

mysql varchar 查詢問(wèn)題 ?

mysql varchar 查詢問(wèn)題 
查看完整描述

5 回答

?
陪伴而非守候

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超8個(gè)贊

根據(jù)你1,2點(diǎn)原因我做出如下推斷:
你導(dǎo)進(jìn)去的數(shù)據(jù)daihao字段varchar是否包含了空格或者其它特殊字符,或者存在編碼問(wèn)題;
select * from a where daihao= 18這個(gè)查詢工具自動(dòng)轉(zhuǎn)成了數(shù)字類型,肯定是查詢沒(méi)有問(wèn)題的。

查看完整回答
反對(duì) 回復(fù) 2019-04-23
?
縹緲止盈

TA貢獻(xiàn)2041條經(jīng)驗(yàn) 獲得超4個(gè)贊

直接用> < 啊
比如
select * from 表 where 字段 > 100
---補(bǔ)充
你什么數(shù)據(jù)庫(kù)啊。varchar類型也可以用。
create table test(
col1 varchar(2)
)
declare @i int
set @i = 1
while @i< 100
begin
insert into test values(convert(varchar(2),@i))
set @i = @i + 1
end
select * from test where col1 > 50 --正確
select * from test where convert(numeric(10),col1) > 50 --正確
select * from test where col1 > '50' --錯(cuò)誤
drop table test
你自己測(cè)試吧
如果你非要把類型轉(zhuǎn)成數(shù)值型也可以但這是用不到索引了



查看完整回答
反對(duì) 回復(fù) 2019-04-23
?
守著一只汪

TA貢獻(xiàn)1872條經(jīng)驗(yàn) 獲得超4個(gè)贊

可以把varchar轉(zhuǎn)換成別的類型
比如 decimal,float之類
例:
select * from 表 where convert(float,字段)>100

查看完整回答
反對(duì) 回復(fù) 2019-04-23
?
哆啦的時(shí)光機(jī)

TA貢獻(xiàn)1779條經(jīng)驗(yàn) 獲得超6個(gè)贊

條件語(yǔ)句
where id != '1' and id != '2' --id字段為char、nchar、varchar型等等

where id != 1 and id != 2 --id字段為int、smallint型

查看完整回答
反對(duì) 回復(fù) 2019-04-23
?
慕俠2389804

TA貢獻(xiàn)1719條經(jīng)驗(yàn) 獲得超6個(gè)贊

查詢的時(shí)候加個(gè)這個(gè),distincy,舉個(gè)例子:$list['pay_user'] = $this->get_table("orders")->where("pay_time>=$time2 and pay_time<$time1 and is_recharge=%d and statu=%d",1,1)->count('DISTINCT username');就這樣,你就可以查出不相同的字段了

查看完整回答
反對(duì) 回復(fù) 2019-04-23
  • 5 回答
  • 0 關(guān)注
  • 1508 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)