Ⅰ sql 中查詢不以 3 5 6 7開頭的信息
select *from xxx_table where 某ID nto (like '3%' or like '5%' or like '6%' or like '7%')
Ⅱ SQL語句:有個欄位brand_code,我如何查詢不是一數字開頭的brand_code的所有信息
select brand_code from 表名 where ascii(brand_code)>57 or ascii(brand_code)<48
給分吧
ascii 是個函數,返回的是字元串的最左端的字元的ascii碼
既然你在線 給分 給分
Ⅲ mysql SQL查詢一個欄位不是數字開頭 如何寫
NOT REGEXP '^[a_z]' 用正則匹配首字母
Ⅳ sql server 創建資料庫主文件邏輯名為什麼不能是數字開頭
不因為什麼,大多數資料庫都不能以數字開頭,這是資料庫的開發規范要求。
Ⅳ sql語句 查詢 非數字字元
把數字全部轉化成ascii碼 然後來判斷。下面是個例子。
這題給5分太少了點,呵呵。
DECLARE @position int, @string char(15),@t_num varchar(50)
DECLARE cursor_r cursor for select t_num from tab2
open cursor_r
fetch next from cursor_r into @string
begin
while @@fetch_status =0
begin
--print @string
SET @position = 1
WHILE @position <= len(@string)
BEGIN
set @t_num =ASCII(SUBSTRING(@string, @position, 1))
if @t_num<48 or @t_num>57
begin
insert into tab3 (t_num) values(@string)
break
end
SET @position = @position + 1
END
fetch next from cursor_r into @string
end
close cursor_r
deallocate cursor_r
end
這題給5分太少了點,呵呵。正好我以前寫過,就無私奉上了。
Ⅵ t-sql合法標識符首字元不能為數字
不能第一個字元必須是Unicode 2.0標准所定義的字母,下劃線,@符號和數字元號(#)
一般128之間,對於本地臨時表,標識符最多可以有116個字元.
@符號表示局部變數或參數
@@開始的標識符表示全局變數
一個數字元號(#)開頭的標識符表示臨時表或過程;
以及雙數字元號(##)開始的標識符表示臨時表或過程;
Ⅶ SQL中條件C002不等於數字69開頭的語句怎麼寫
用like或left或substr之類的效率都很差,如果確定都是數字組成,可以使用
C002>='70' or C002<'69'
Ⅷ SQL語句:select查詢值必須不以」8」開頭,但必須包含字元」8」;
下面是某個資料庫中的ID號不以8開頭但是中間必須包括8的查詢語句。
select *
from 制單人信息表
where ID號 like '[^8]%8%'
切勿復制中文狀態下輸入的『』,在查詢分析器中會顯示錯誤!最好自己寫。