Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How does one query for %?

0 views
Skip to first unread message

SafeEarthSafeChild

unread,
Aug 14, 2007, 2:09:18 AM8/14/07
to
In TransactSQL % is the wildcard
SELECT *
FROM Table
WHERE Table.Field LIKE '%Example%'

But how do I find "% solids" or just "%"?

--
Jennifer Gibbons
Hold your dreams close to your heart, give them wings, and let them fly.
http://safeearthsafechild.fourpointmoms.com


Jack Jackson

unread,
Aug 14, 2007, 2:35:35 AM8/14/07
to
On Tue, 14 Aug 2007 06:09:18 GMT, "SafeEarthSafeChild"
<safeearth...@yahoo.com> wrote:

>In TransactSQL % is the wildcard
>SELECT *
>FROM Table
>WHERE Table.Field LIKE '%Example%'
>
>But how do I find "% solids" or just "%"?

The SqlServer TransactSQL Help says there are two ways to do this.
1. Enclose the % in square brackets.
2. Use the ESCAPE clause to specify a character that makes the next
character be treated as an ordinary character:
match_expression [ NOT ] LIKE pattern [ ESCAPE escape_character ]

0 new messages