How to combinate the two sqlite statements into one ?i want just one statement do get the result.
create table lowprice as select code,date,min(close) as min_close from quote where date between '20120730' and '20121030' group by code;
select * from lowprice where lowprice.date between '20121025' and '20121030' ;
You can use a derived table (subquery) instead of creating an actual table:
However this query looks suspicious because you are grouping by
codebut selectingdate. This is a MySQL extension called GROUP BY and HAVING with hidden columns. You should only use this extension if you understand why this query is invalid in most databases and why MySQL chooses to allow it. It is quite likely that this query does not do what you expect.