sqlite - WHERE statements using a multiple of two columns
<p>I am currently working on a project using sqlite in python 2.7 and need to return rows where the value of column A * column B is greater than a certain number. Here is what the code looks like:</p>

<pre><code>c.execute('SELECT * FROM table_1 WHERE validation=1 AND colA * colB &gt; 10000')
</code></pre>

<p>The only issue is that this doesn't work... I know it's possible in MySQL so I was hoping it would also work in sqlite, although I haven't had any luck finding a means of getting this done.
So my questions is: Is it possible to perform this type of operation with sqlite and if yes, how?</p>

<p>EDIT: Here is more complete code, I honestly had assumed that I had a small syntax error or it simply wasn't possible. Because my code is quite long, I don't feel it's possible to post everything. The table I am trying to query was built as follows:</p>

<pre><code>    c.execute('CREATE TABLE IF NOT EXISTS table_1(ticker TEXT, colA INTEGER, colB INTEGER, company_name TEXT, market_cap TEXT, sector TEXT, validation INTEGER, UNIQUE(ticker) ON CONFLICT IGNORE)')
</code></pre>

<p>The first few entries in the table are as follows:</p>

<p>ticker,colA,colB,company_name,market_cap,sector,validation</p>

<p>"ACFN","0.18","71,200","Acorn Energy","5.16M","Industrial","1"</p>

<p>"ADGE","0.3","64,458","American DG","14.71M","Industrial Goods","1"</p>

<p>"ACUR","0.97","66,358","Acura Pharmaceuticals","11.52M","Healthcare","1"</p>

<p>Also, using the following statement does return the last row from above.</p>

<pre><code>c.execute('SELECT * FROM table_1 WHERE validation=1 AND colB &gt; 25000 AND colA&gt; 0.5')
</code></pre>

<p>But if this statement returns the last column, then my original code which multiplies colA with colB should do the same.</p>