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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unexpected result from SQL wildcard Select

Status
Not open for further replies.

GBall

Programmer
Joined
May 23, 2001
Messages
193
Location
GB
Hi,
can anyone tell me why this select

SELECT TABLE_NAME FROM user_tables where table_name like 'P_%'

returns

PLAN_TABLE





Regards,
Graham
 
OK, never mind.
Found the answer.

Regards,
Graham
 
For the benefit of others, I'll add the answer.

The underscore (_) is Oracles default wildcard character for replacing a single character in a string.

For example, [tt]WHERE column LIKE 'P_'[/tt] would return all strings two characters in length beginning with P. However, [tt]WHERE column LIKE 'P%'[/tt] would retrun all strings beginning with P, regardless of its length.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top