with cte as( select *, Dense_Rank() over (partition by DAY(day) order by amount desc ) DR from Transactions_Sat ) select transaction_id from cte where DR=1 order by transaction_id
select transaction_id from( select *, dense_rank() over(partition by date(day) order by amount desc) as dr from Transactions ) where dr = 1 order by transaction_id
with cte as( select *,max(amount) over(partition by day(day)) as dt from transactions) select transaction_id from cte where amount=dt order by transaction_id another approach
This column is created using window function so you cannot use it filter. You have to save the results in a table using sub query or CTE than you can use the column to filter it!
with cte as(
select *,
Dense_Rank() over (partition by DAY(day) order by amount desc ) DR
from Transactions_Sat
)
select transaction_id from cte where DR=1 order by transaction_id
select transaction_id
from(
select *, dense_rank() over(partition by date(day) order by amount desc) as dr
from Transactions
)
where dr = 1
order by transaction_id
with cte as(
select *,max(amount) over(partition by day(day)) as dt from transactions)
select transaction_id from cte where amount=dt order by transaction_id
another approach
Wrong
@@sportsofficial6374 bro kindly runs this code in MySQL it will definitely work .
Thanks & regards
@@sportsofficial6374 bro kindly run this code in MySQL it will definitely work .
Thanks & regards
@@sportsofficial6374 bro kindly run this code in mysql it will definetly work
bro can u plz reduce the price of sql datasets or can u plz make a tutorial on how to scrap the required data
Hi mate!
Please dm instagram.com/zero_analyst/
Im new to sql. Why didn't you specify the where ranks =1 in the original select statement. Why did you have to do a sub-query first?
This column is created using window function so you cannot use it filter. You have to save the results in a table using sub query or CTE than you can use the column to filter it!
❤