vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello - I was looking for something like 'WHERE field IS NUMERIC', ala 'WHERE field IS NULL' . I have an ENUM field that can be 1,2,3,4,5 or 'N/A'. I would like to do a SUM(answer) WHERE answer IS NUMERIC, so as to exclude the N/A from the summing of the answers. What's the best way to do this? A regex in the where clause? |
| ||||
| On Tue, 22 Apr 2008 21:29:48 +0200, <lawpoop@gmail.com> wrote: > Hello - > > I was looking for something like 'WHERE field IS NUMERIC', ala 'WHERE > field IS NULL' . > > I have an ENUM field that can be 1,2,3,4,5 or 'N/A'. I would like to > do a SUM(answer) WHERE answer IS NUMERIC, so as to exclude the N/A > from the summing of the answers. > > What's the best way to do this? A regex in the where clause? Euhm, WHERE field != 'N/A' would be the way to go in the case you describe. -- Rik Wasmus |