Home » SQL & PL/SQL » SQL & PL/SQL » subset
subset [message #202224] Wed, 08 November 2006 16:20 Go to next message
roopla
Messages: 52
Registered: May 2006
Member
I have table with two fields
id desc
1 var100
2 var101


100 var400



I have to select rows where desc is in between var150 and var157
How can I achieve this without doing any manipulation

Thanks in advance
Re: subset [message #202225 is a reply to message #202224] Wed, 08 November 2006 16:28 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
use BETWEEN
Re: subset [message #202312 is a reply to message #202224] Thu, 09 November 2006 01:47 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
As @Anacedent says,
WHERE DESC BETWEEN 'var150' AND 'var157'
would work, as would
WHERE substr(desc,4) BETWEEN 150 and 157

Wat do you mean when you say 'Without doing any manipulation'?
Re: subset [message #202316 is a reply to message #202312] Thu, 09 November 2006 01:53 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Tsk. Implicit casting.

MHE
Re: subset [message #202319 is a reply to message #202316] Thu, 09 November 2006 02:01 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Pedant.
WEHRE to_number(substr(DESC,4)) BETWEEN 150 and 157
Re: subset [message #202320 is a reply to message #202319] Thu, 09 November 2006 02:04 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Sorry, will shut up now. Very Happy

MHE
Previous Topic: QP_PRICE_LIST_PUB.Process_Price_List not inserting Data
Next Topic: Table Audit - INSERT with Particular Value on Past date
Goto Forum:
  


Current Time: Fri Dec 02 16:36:36 CST 2016

Total time taken to generate the page: 0.47885 seconds