07-19-2010 7:43 AM
Hello gurus,
I simply want to check if at least one records of given where-clause already exists. Is there a difference between above mentioned statements?
Regards,
Alej
07-19-2010 8:05 AM
the correct solution is SELECT f1 UP TO 1 ROWS !!!!
You should not use COUNT(*), at least on some databases it will count all records fulfilling the condition.
YOU should not use SINGLE, because ... search top entries there are endless discussion on UP TO 1 ROWS and SINGLE
07-19-2010 8:05 AM
the correct solution is SELECT f1 UP TO 1 ROWS !!!!
You should not use COUNT(*), at least on some databases it will count all records fulfilling the condition.
YOU should not use SINGLE, because ... search top entries there are endless discussion on UP TO 1 ROWS and SINGLE
07-19-2010 9:40 AM
Hello Siegfried,
thanks for your quick reply.
Could you provide some links to official documentation to prove these theses? I already searched, but I could finded any references to your assumptions.
Thanks in advance and best regards,
Alej
07-19-2010 12:54 PM
there is nothing officially published by SAP.
But my word should be enough , see here
http://www.dpunkt.de/suche/ergebnis?modus=einfach&author=&title=&keyword=boes
There you find source with exercise programs, run test case No. 381 and 382. I do not comment on the DB platforms but
I tried the 4 major ones.
Siegfried