tag:blogger.com,1999:blog-17069431.post3745774804658324958..comments2023-07-21T09:35:35.587+02:00Comments on Talk2Gerd: LOV with splitted dataGerd Volberghttp://www.blogger.com/profile/00634342057996329457noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-17069431.post-65282094932231486982008-02-08T14:21:00.000+01:002008-02-08T14:21:00.000+01:00Ok, sorting is important, I know. In case of my sp...Ok, sorting is important, I know. In case of my split-select I have to select like this:<BR/><BR/>select '---new colleagues---' ename, NULL job, NULL hiredate<BR/> from dual<BR/>UNION ALL<BR/>select ename, job, hiredate<BR/>from (sorted select with where-clause)<BR/>UNION ALL<BR/>select '---before 07/81---' ename, NULL job, NULL hiredate<BR/> from dual<BR/>UNION ALL<BR/>select ename, job, hiredate<BR/>from (sorted select with where-clause)Gerd Volberghttps://www.blogger.com/profile/00634342057996329457noreply@blogger.comtag:blogger.com,1999:blog-17069431.post-6832940247157899182008-02-08T13:29:00.000+01:002008-02-08T13:29:00.000+01:00GerdYou should include ORDER BY:SELECT ename, job,...Gerd<BR/><BR/>You should include ORDER BY:<BR/><BR/>SELECT ename, job, hiredate <BR/>FROM (<BR/> select ...<BR/> UNION ALL<BR/> select ...<BR/> UNION ALL<BR/> select ...<BR/>)<BR/>ORDER BY hiredate <BR/><BR/>or order by ename within subquery - your choice.<BR/><BR/>And make sure you can't pick the "heading" rows.<BR/><BR/>PS I love that "new colleagues" are since 1981 - is it time for the SCOTT company to experience some staff turnover?<BR/><BR/>Regards NigelNigelhttps://www.blogger.com/profile/10826219818302312878noreply@blogger.comtag:blogger.com,1999:blog-17069431.post-63685978918326829532008-02-08T12:04:00.000+01:002008-02-08T12:04:00.000+01:00Wouldn't you have to a bit more to ensure good sor...Wouldn't you have to a bit more to ensure good sorting?Unknownhttps://www.blogger.com/profile/17834080442064607248noreply@blogger.com