I have a table which have records like this I’m trying to get the Max Date for each ID which have STATUS = ‘N’. If I get MAX DATE and STATUS = ‘C’ then I don’t want that record. Output : SCRIPT : But I’m not able to get desired output. Answer You can use NOT EXISTS: If the column’s
Tag: date-formatting
Write a query to display the total month wise sales amount received in the past 1 year
Table StructureWrite a query to display the total month wise sales amount received in the past 1 year . Display details like sales month, total sales amount. Give an alias_name as MONTH for retrieved sales month, TURN_OVER for sales amount. Sort the result by amount in descending order. (Hint: Use table Sales_info. Use to_char for retrieving the month. Net amount
SQL not using ALIAS column for calculation
Question Statement – From the given trips and users tables for a taxi service, write a query to return the cancellation rate in the first two days in October, rounded to two decimal places, for trips not involving banned riders or drivers. Question code on Oracle SQL. My Solution Code is below. However, I get the following error. Can someone
How to convert date format in SQL Query Results?
I want to display Date fields in SQL Query Results as DD-MM-YYYY Format. In table it is vice versa. When I try with below query it does not works. SQL Query Link: (Tables can be retrieved by clicking …