September 28, 2001 at 1:14 am
somebody please tell me how to query data like below
table : test.dbo
ID Desc qty
-----------------------
1 Oil, chem 1
2 Oil, chem 1
3 gas, oil 1
4 bez, oil, gaz 1
-----------------------
how to show all desc = "oil" using select
if in visual foxpro should be like ...
"brow for alltrim("oil") $ alltrim(desc)"
i don't know what is similar with "alltrim" in SQL server.
Thank you all.
September 28, 2001 at 11:17 am
alltrim in Foxpro means strip all leading and trailling spaces. Its like doing a Rtrim(Ltrim(desc)).
TSQL Rtrim - trims off trailling spaces
TSQL Ltrim - trims off leading spaces
However I don't beleive your query really needs to strip the leading or tailling spaces. I would just do a :
SELECT * where desc like '%oil%'
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy