Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql Select Question

Status
Not open for further replies.

1SorryDog

Technical User
Jul 15, 2002
25
US
This maybe a dummy question but here goes....

Not sure which SQL forum to post this question but...
I have a select statement for an ORACLE database similar to this:

SELECT * FROM MY_TABLE WHERE DESCRIPTION = '1234-GEORGE'

The DESCRIPTION field is defined as variable charater. It seems that the minus sign in killing the select statement. No rows returned.

However this works:

SELECT * FROM MY_TABLE WHERE DESCRIPTION LIKE '1234%'

But, I need the remaining charaters after the dash as they can be anything, for exapmle DESCRIPTION = '1234-TOMMY'

Is there any way for sql to see the minus sign as a dash or string charater instead of a minus sign???

Any suggestions would be appreciated.

One last note, the minus sign can't be eliminated as this is as example of a part number.


Thanks.


SorryDog
 
This forum is for Microsoft SQL Server. You're looking for an oracle forum forum759

You are likely to get a more timely answer in that forum.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks gmmastros. I couldn't find an ORACLE forum from the listing.

Since I don't know how to move the post, I'll post over there.


Thanks for the tip.


SorryDog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top