Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Select Description Like %


Message #1 by "Siew Lien" <sl.chin@f...> on Mon, 21 Oct 2002 10:03:40 +0800
yeap.. this will work as well.. thank you so much .. :)

----- Original Message -----
From: <pgtips@m...>
To: "sql language" <sql_language@p...>
Sent: Monday, October 21, 2002 09:23 AM
Subject: [sql_language] Re: Select Description Like %


> Just put it in [], like this:
> SELECT * FROM tblTest WHERE desc LIKE '%[%]%'
>
> or specify an escape char to use:
> SELECT * FROM tblTest WHERE desc LIKE '%#%%' ESCAPE '#'
>
> This works for SQL Server anyway.
>
> Phil
> >----------------------------------------------
> > Hi,
>
> I need to build a query string to search from a column desc in tblTest.
> If my column desc can contain character "%"
> how do i build the SQL statement with only getting those description
> with "%" ?
>
> for example
>
> id      desc
> 1       test%2b
> 2       test_2c
> 3       test%hhhh
>
>
> if i perform the select statement
> SELECT * From tblTest WHERE desc LIKE '%'
>
> all the 3 records will be display. Indeed, I olny need record with id=1
> and 3
>
> Please advise.. thanks ...^_^
>
>
>
> Regs,
> Siew Lien
>


  Return to Index