question

mondy99 avatar image
mondy99 asked

Top 10 DateDiff for FK_Column

I have 2 SQL tables, one for subscribers (ID, Name), second for subscribers_Upgrades [Subscriber_ID (FK), Upgrade_Level, Upgrade_Date) Note:There are 7 upgrade levels as follow : 1- Basic 2- Pre-Intermediate 3- Intermediate 4- Advanced 5- One Star Advanced Manager 6- Two Star Advanced Manager 7- Three Star Advanced Manager I need a query to get the top 10 subscribers who upgraded in the shortest period and Upgrade_Level, and Upgrade Date for specific Upgrade_Level (any one of the available 7 Upgrade level), and within specific period of time I mean by shortest period (the subscribers who take short period to upgrade to 'advanced' level from Level Intermediate(assuming we need to get subscribers who upgrade faster to level 3) We can, for example supply the 2 conditions like Where Upgrade_Level = 3 and Upgrade_Date between '01-April-2014' and '20-May-2016'
loopdatediff
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@mondy99. How many times are you going to ask the same question with nowhere near enough information for somebody to help? Here would be a great place for you to start getting answers. http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.