sql - Show data that is only from a specific quarter -
I need to show the data that is any quarter of any year only. Where I am trying to use to_date in the segment but it is giving me an error, not sure which mistake I am getting. (Use Oracle 10g)
code:
select product_name, include a_product p a_item i p.product_id = i.product_id a_sales_order so many I.order_id = so.order_id join a_customer C. so.customer_id = c.customer_id Where regexp_like (PRODUCT_NAME, 'transducer') and ORDER_DATE = TO_DATE (2, 'Q')
And that part is where I'm having trouble, it is giving me a "format code date can not appear in the date format" ORDER_DATE is the table that I have to find out how to sell The use of what was done in the second quarter of the year was within the area.
You have the debate behind. I think you want to be:
and TO_CHAR (ORDER_DATE, 'Q') = '2'
The function TO_CHAR ()
(in this context) takes a date and it is a string Formatted as What is the string? In it, a string with a quarter, then you want to compare it to the price.
Comments
Post a Comment