I have written SQL query in jaspersoft studio
Select Orderid , Orderdate , Shipcity,
year(Orderdate) as year, month(Orderdate) as month
from Orders
where Orderid IN
(
SELECT EXTRACT(YEAR FROM Orderdate) ,
EXTRACT(MONTH FROM Orderdate)
from Orders
where (
year(Orderdate) = Startyear
AND
month(Orderdate) = Startmonth
)
)
This is the query
Your SQL, as written, doesn't make a lot of sense. The subquery after
where Orderid IN
needs to return a single field containing order Ids but instead you've written something that returns 2 fields, neither of which appear to be an Order Id
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.