python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
SQL Top N per group each year without using row_number / rank or variables
I have a limitation of not being able to use window functions or variables due to tool constraints. (Sorry couldn't elaborate much) but is there any scalable way to get Top N per group for each year? ...
unacorn
Votes: 0
Answers: 1
Select Only the Most Recent Row
I'm using a query to pull the valuation cost of projects. It works well, except sometimes it returns multiple rows for a valuation.
How can I modify my query to get only the most recent record to avoi...
GTS Joe
Votes: 0
Answers: 2
How can I retrieve distinct data by using group by
I have following table and its sample data as follows,
+------------------+-------+--------+---------------------+-------+
| PhoneCode | SeqID | Active | Token | CUSID |
+--------...
NAKED_DEVELOPER
Votes: 0
Answers: 5
DISTINCT nor GROUP BY doesn't work to return unique values
SELECT DISTINCT order_reference as barcode,
mth.location as location,
mth.last_update_ts as updated
FROM sales_order_header soh
INNER JOIN manufacturing_tracking_history mth
ON soh.id = mt...
Pat
Votes: 0
Answers: 1