order by原来也可以这样
You Asked?and we said...
seems like a very very strange sort of "thing". But always - very very VAGUE. I presume you want the "least element last"since nulls sort "last"ops$tkyte@ORA10GR2> select * from test1 2 order by decode( c1, (select min(c1) from test1), to_number(null), c1); C1---------- 2 3 4 5 1the to_number is 100% relevant, we want the decode to return a number, not a string.About all you want to say with regards to the last question is that the BEFORE TRIGGER will fire and then the after/check constraint will be done.If you have some reliance on the order of the check/after trigger - we need to talk, you have a seriously flawed design issue we'll need to resolve.If the after trigger fires first and the check constraint fails, the after trigger will rollback.If the after trigger fires second and the check constraint fails, the after trigger will not have happened so it'll be just as if the after trigger had fired since no work will persist.So, while we could set up a test case to see which order they appear to fire in - that would be entirely an empirical observation subject to change. There should be no logical impact on your application if they go A and then B or B and then A however. If there is, we need to fix that :)