Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Nandhini Jayachandran
2k
117
39.8k
top 3 branch name using oracle query
Jun 21 2014 3:41 AM
SELECT T.*,S.* FROM ( Select TD.category_name,TD.branch_name,TM.created_date,TM.user_id,TD.order_details_id,TD.branch_id From tbl_orderdetails TD Inner Join tbl_ordermaster TM ON TD.order_master_id = TM.ordermasterid Where TM.user_id='12' ) T Inner Join ( SELECT M.branch_name,Max(M.No_Of_Branch) FROM ( Select T1.branch_name,Count(T1.branch_name) As No_Of_Branch From tbl_orderdetails T1 Inner Join tbl_ordermaster T2 ON T1.order_master_id = T2.ordermasterid Where T2.user_id='12' Group By T1.branch_name ) M Group By M.branch_name ) S On S.branch_name = T.branch_namei want only max number of times the branch name came and top 3 to be displayed . for eg vellore=100 ,chennai=18,tvl=80,harithuwar=90 vellore harithwar tvl should only display
Reply
Answers (
0
)
crystal report and oracle connection using asp.net (web app)
Is it possible to do autoincrement