SQLite3 select field by numeric range, Expanded, pt2

I just asked (and was kindly answered)

This question: SQLite3 select field by numeric range

But now if I have the table

rowid     value1    value2    type
(int)     (float)   (float)   (char)
1         15.3      20.2      W
2         17.8      30.5      W
3         15.8      25.3      S
4         16.1      48.0      WT

How can select those rows where type='W' & type='S' and 15 <= value1 <= 16.6 and 30.0 <= value2 <=30.0 ?

I try as someone suggested on my previous question to use AND, but for the strings something like this:

SELECT * FROM EN WHERE type='S' and type='W';

Does not work, it returns an empty result (I'm using SQLite manager extension for Firefox).

And there are hundreds of both W, S, WT types in the database.

Answers


SELECT * 
FROM   en 
WHERE  ( TYPE = 'S' 
          OR TYPE = 'W' ) 
       AND ( value1 BETWEEN 15 AND 16.6 
             AND value2 BETWEEN 30.0 AND 40.0 ) 

Need Your Help

Change smtp outgoing port on PostFix

email ubuntu port postfix-mta dovecot

I have PostFix set up and everything is working, except I can't send emails. Now I know most ISPs ports block port 25, as can be seen in this error log entry:

tfs build definition with no drop folder

tfs tfs2010 build-automation

I've recently changed a number of my builds to not have a drop folder but now I'm getting the following error when I do this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.