|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
View and Order BY
Can you sort a view by using Order By? Everytime I try it the view can not by created.
Thanks |
|
#2
|
||||
|
||||
|
No, or at least I hope not, some databases allow to specify an order by clause in view definition, but it's plain stupid!
Why? Because ordering results takes a lot of load on the database server, so doing a select * from (ordered view) or select * from (unordered view) order by x has the same cost, but any other ordering puts double strain on the database server (one for the ordering specified in the view, the other for sorting data in the order specified by the user). Hope this helps!
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > View and Order BY |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|