Oracle中關鍵字like的使用總結

來源:互聯網
上載者:User

Oracle中關鍵字like的使用總結

在Oracle中使用like進行模糊查詢:

假設表名為:hs_test;欄位名為client_id

1.查詢client_id中有03的:

select  client_id from hs_test  where client_id like '%03%'

2.查詢client_id中以03開頭的:

select client_id from hs_test where client_id like '03%'

3.查詢client_id中以03結尾的:

select client_id from hs_test where client_id like '%03'

4.查詢client_id中含有字母的:

select client_id from hs_test where client_id like '%[a-z]%'

5.查詢client_id中含有數位:

select client_id from hs_test where client_id like '%[0-9]%'

其他的可以根據以上的幾種形式進行擴充,這裡也就不一一介紹了。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.