Subject | only for numerics... |
---|---|
Author | Rony Cesana |
Post date | 2006-03-11T14:59:07Z |
Hi everybody,
I wondered whether there's any chance of filtering in a where clause all the
numbers... even though I'm not sure they're numbers!!!
Having
CREATE TABLE Test(AFIELD VARCHAR(32));
INSERT INTO Test(AFIELD) VALUES ('abc');
INSERT INTO Test(AFIELD) VALUES ('15');
INSERT INTO Test(AFIELD) VALUES ('30');
I'd like to extract only the second record, saying something
SELECT * FROM Test
WHERE CAST(AFIELD AS INTEGER) < 20;
The above example, obviously, doesn't work... otherwise would I be posting
this? ;))
Thanks in advance,
Rony
I wondered whether there's any chance of filtering in a where clause all the
numbers... even though I'm not sure they're numbers!!!
Having
CREATE TABLE Test(AFIELD VARCHAR(32));
INSERT INTO Test(AFIELD) VALUES ('abc');
INSERT INTO Test(AFIELD) VALUES ('15');
INSERT INTO Test(AFIELD) VALUES ('30');
I'd like to extract only the second record, saying something
SELECT * FROM Test
WHERE CAST(AFIELD AS INTEGER) < 20;
The above example, obviously, doesn't work... otherwise would I be posting
this? ;))
Thanks in advance,
Rony