Amezis 0 Report post Posted March 29, 2006 I have a int column with numbers, and I want to show only the numbers between 5 and 20 in that column.So my list would be like this: 571516 I know how to only show numbers that are less than 20 or greater than 5, but I can't manage to combine those two (Less than 20 AND greater than 5).So I guess it would be something like this:SELECT * FROM `table` WHERE `introw` >= 5 && <= 20How can I do that? Share this post Link to post Share on other sites
Inspiron 0 Report post Posted March 29, 2006 Try this. SELECT * FROM Table WHERE Column>= 5 AND Column<= 20 This is another alternativeSELECT * FROM Table WHERE Column BETWEEN 5 AND 20 Please take note that there is no ' signs to enclose the table name and column name. Share this post Link to post Share on other sites
Amezis 0 Report post Posted March 29, 2006 Thanks alot! Share this post Link to post Share on other sites
Spectre 0 Report post Posted March 30, 2006 Just as a side note, table and field names can be enclosed in ` symbols (note that it is a grave accent mark, and not a standard quotation mark as you would use to delimit a string value), but it is not required. It is often useful to make it easier to spot the tables/fields referenced, and as it doesn't have any influence on performance whatsoever, it doesn't really make any difference whether you use it or not. Share this post Link to post Share on other sites
Amezis 0 Report post Posted March 30, 2006 I know, and I use to use the ` symbols. Thanks for telling me anyway Share this post Link to post Share on other sites
Inspiron 0 Report post Posted March 30, 2006 Oh Spectre thanks. I didn't know that SQL statements accept ' signs. For me to differentiate between the table or column names and the SQL codes, I usually use block letters for SQL codes and follows the same cases for the table and column names as in the database. Now I'm learnt something new too, that I never realised. Share this post Link to post Share on other sites