+B所有数字类型加法A-B所有数字类型减法A*B所有数字类型乘法A/B所有数字类型除法A%B所有数字类型取模A&B所有数字类型位与A|B所有数字类型位或A^B所有数字类型位异或~,req_num均为INT类型,result为BOOLEAN类。selectgdrtype,req_num,gdrtype+req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype-req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype*req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype/req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype%req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype&req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype|req_numfromgdrlimit1;selectgdrtype,req_num,gdrtype^req_numfromgdrlimit1;selectgdrtype,~gdrtypefromgdrlimit1;selectgdrtype,gdrtype+'2'fromgdrlimit1;selectgdrtype,gdrtype-'2'fromgdrlimit1;selectgdrtype,gdrtype*2fromgdrlimit1;selectgdrtype,gdrtype/2fromgdrlimit1;selectresult,result+2fromgdrlimit1;selectresult,result-2fromgdrlimit1;selectresult,result*2fromgdrlimit1;selectresult,result/2fromgdrlimit1;+-运算时,需要添加在常数数字上添加单引号’’(作为string类型运算),但*/运算不需要,如上例;,但不能和数值型的操作数(列名)运算;布尔型可以和数值进行乘法运算,也可以进行除法运算,如下CREATETABLEyunsuan(ttinyinttinyint,tsmallsmallint,tintint,tbigintbigint,tfloatfloat,tdoubledouble,tstringstring,tbooleanboolean,tnumbernumber,ttimestamptimestamp,primarykey(ttinyint));布尔型列tboolean可以运算如下,selecttboolean+100,tboolean+,tboolean*2,tboolean/=1;[NOT]EXISTS(subquery) ,start_time均为BIGINT类型select*fromgdrwheremsisdn=**********andstart_time=1282824875252;select*fromgdrwheremsisdn=**********orstart_time=1282824875252;select*fromgdrwherenot(msisdn=**********);select*fromgdrwhereexists(selectgdrtypewheremsisdn=**********);,必须使用关键字“AND”和“OR”。=B所有基本类型等于A<=>B所有基本类型等于A!=B所有基本类型不等于A<>B所有基本类型不等于A<B所有基本类型小于A<=B所有基本类型小于等于A>B所有基本类型大于A>=B所有基本类型大于等于AISNULL所有类型判断为空AISNOTNULL所有类型判断不为空ALIKEBSTRING字符串A是否与
字符串函数String 来自淘豆网m.daumloan.com转载请标明出处.