December 13, 2011 at 12:44 am
I need a record order by the count descending but it is not taking order by desc count column
What should i do??
Thanks & Regards,
Pallavi
December 13, 2011 at 12:48 am
pallavi.unde (12/13/2011)
I need a record order by the count descending but it is not taking order by desc count columnWhat should i do??
Why do you want ORDER BY in view at first place? You can query a view with ORDER BY.
SELECT *
FROM trialbase -- Your View
ORDER BY becount desc
December 13, 2011 at 12:59 am
Bcount is not a column in any table... that is the column made by count() function where i used alias aa bcount.
and bcount is going to update at every time.
Thanks & Regards,
Pallavi
December 13, 2011 at 1:03 am
pallavi.unde (12/13/2011)
Bcount is not a column in any table... that is the column made by count() function where i used alias aa bcount.and bcount is going to update at every time.
Agree. But you can query on view and there it would be consider as regular column. Please check my last post again.
December 13, 2011 at 1:29 am
As Dev suggests, ditch the ORDER BY. The only thing that will guarantee sorted results is if you use an ORDER BY when you call the view, so leave it out of the view definition. If you must use it, you can't refer to a column alias - you have to put the whole aggregate statement in again.
John
December 13, 2011 at 2:05 am
Yes It's working
I used
SELECT * FROM
view order by becount desc
It proved need not to use trigger.. 🙂
Thanks & Regards,
Pallavi
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply