![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi there, How can I extract values for "members whose level is below '3', and their names are between the alphabets 'a' and 'b' "? For example, one of the results should be 'Alex', whose level is '1'. Or 'Bob', whose level is '2'. But not Charlie, or Tom...etc. I tried a query like SELECT uid FROM members WHERE level > '1' AND name between 'a' and 'b', |
|
but it does not work.... Could anyone give me a good solution? Thanks for your help in advance. Lingua -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=b...) vio (DOT) ro |
#3
| |||
| |||
|
|
How can I extract values for "members whose level is below '3', and their names are between the alphabets 'a' and 'b' "? For example, one of the results should be 'Alex', whose level is '1'. Or 'Bob', whose level is '2'. But not Charlie, or Tom...etc. I tried a query like SELECT uid FROM members WHERE level > '1' AND name between 'a' and 'b', but it does not work.... There's a problem with the condition on level, as George and Peter have |
#4
| |||
| |||
|
|
Like this? mysql> select * from t2; +---------+--------+ | name | number | +---------+--------+ | bob | 3 | | bob | 2 | | bob | 1 | | al | 1 | | al | 2 | | al | 3 | | al | 4 | | adam | 4 | | adam | 3 | | adam | 2 | | charlie | 2 | +---------+--------+ 11 rows in set (0.00 sec) mysql> select * from t2 where (number <3) and (name between 'a' and 'c'); +------+--------+ | name | number | +------+--------+ | bob | 2 | | bob | 1 | | al | 1 | | al | 2 | | adam | 2 | +------+--------+ 5 rows in set (0.00 sec) Is that what you mean? ================================================== ==================== Bob Ramsey Applications Development & Support II ph: 1(319)335-9956 216 Boyd Law Building fax: 1(319)335-9019 University of Iowa College of Law mailto:robert-ramsey (AT) uiowa (DOT) edu Iowa City, IA 52242-1113 For Hardware and Software questions, call 5-9124 ================================================== ==================== |
![]() |
| Thread Tools | |
| Display Modes | |
| |