access中有LIKE吗?

leiming 2004-12-09 05:21:14
想做模糊查询,不知道ACCESS中怎么写SQL语句?

想达到类似这样的目的:select * from table where name like '%a%'
查出所有名称中包含'a'的记录
...全文
3574 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
oyljerry 2004-12-11
  • 打赏
  • 举报
回复
access中用*
bluedue 2004-12-11
  • 打赏
  • 举报
回复
access可以用%
赖勇浩 2004-12-11
  • 打赏
  • 举报
回复
SQL Server中用%
Access中用*


这个是正解,帮我解决问题了啊,谢谢你/
chyf212 2004-12-10
  • 打赏
  • 举报
回复
把*号改成%就可以用啦
dgm8 2004-12-10
  • 打赏
  • 举报
回复
自己试一试
dgm8 2004-12-10
  • 打赏
  • 举报
回复
我都用的select * from table where name like '%a%' ,asp里,jet sql,
一直都正常。
liuyann 2004-12-09
  • 打赏
  • 举报
回复
ACCESS中LIKE的用法

Like Operator
Compares a string expression to a pattern in an SQL expression.

Syntax
expression Like “pattern”

The Like operator syntax has these parts:

Part Description
expression SQL expression used in a WHERE clause.
pattern String or character string literal against which expression is compared.


Remarks
You can use the Like operator to find values in a field that match the pattern you specify. For pattern, you can specify the complete value (for example, Like “Smith”), or you can use wildcard characters to find a range of values (for example, Like “Sm*”).

In an expression, you can use the Like operator to compare a field value to a string expression. For example, if you enter Like “C*” in an SQL query, the query returns all field values beginning with the letter C. In a parameter query, you can prompt the user for a pattern to search for.

The following example returns data that begins with the letter P followed by any letter between A and F and three digits:

Like “P[A-F]###”


The following table shows how you can use Like to test expressions for different patterns.


Kind of match
Pattern Match
(returns True) No match
(returns False)
Multiple characters a*a aa, aBa, aBBBa aBC
*ab* abc, AABB, Xab aZb, bac
Special character a
  • a a*a aaa
    Multiple characters ab* abcdefg, abc cab, aab
    Single character a?a aaa, a3a, aBa aBBBa
    Single digit a#a a0a, a1a, a2a aaa, a10a
    Range of characters
  • [a-z] f, p, j 2, &
    Outside a range [!a-z] 9, &, % b, a
    Not a digit [!0-9] A, a, &, ~ 0, 1, 9
    Combined a[!b-m]# An9, az0, a99 abc, aj0
OracleRoob 2004-12-09
  • 打赏
  • 举报
回复
SQL Server中用%
Access中用*
changechange 2004-12-09
  • 打赏
  • 举报
回复

select * from table where name like '*a*'

7,712

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧