The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,909 other followers

Archive for June 26th, 2018

SQL: “where not exists … having” formulation; anti-join alternative

Posted by jpluimers on 2018/06/26

I need to write up some notes, but there are some links that will help me:

It’s a question of¬†readability. There is no difference in performance.
Old versions of SQL Server were silly enough to look up meta data, but not any more.

SELECT foo FROM bar WHERE EXISTS (SELECT * FROM baz WHERE baz.id = bar.id);
SELECT foo FROM bar WHERE EXISTS (SELECT 1 FROM baz WHERE baz.id = bar.id);

I am not considering NULL or “fun variants” which don’t seem intuitive to me.

SELECT foo FROM bar WHERE EXISTS (SELECT NULL FROM baz WHERE baz.id = bar.id);

SELECT foo FROM bar WHERE EXISTS (SELECT 1/0 FROM baz WHERE baz.id = bar.id);

The question popped up in comments just now. I researched the manuals of the most popular RDBMS:

A search on SO for code:"EXISTS (SELECT 1" yields 5,048 results.
A search on SO for code:"EXISTS (SELECT *" yields 5,154 results.
Updated links and counts 07.2015.

So SELECT * has the popular vote and the big commercial RDBMS on its side.
I find¬†SELECT 1¬†more intuitive. It’s like saying “if at least one exists”.
Is SELECT * more intuitive?

–jeroen

 

 

Posted in Database Development, Development, Firebird, InterBase, MySQL, PostgreSQL, SQL, SQL Server | Leave a Comment »

A Programmer‚Äôs Introduction to Unicode ‚Äď Nathan Reed‚Äôs coding blog

Posted by jpluimers on 2018/06/26

Must read if you do i18n or l10n:¬†[WayBack]¬†A Programmer‚Äôs Introduction to Unicode ‚Äď Nathan Reed‚Äôs coding blog

Via:

[WayBack] Even if you’ve been programming with Unicode for years, this well-written article is worth reading. – Kevin Powick – Google+

–jeroen

 

Posted in Development, internatiolanization (i18n) and localization (l10), Software Development | Leave a Comment »

Settings Migration Tool – RAD Studio

Posted by jpluimers on 2018/06/26

I totally missed that this was introduced in Delphi XE8: [Archive.is] Settings Migration Tool РRAD Studio.

It allows exporting/importing your Delphi settings and migrate them from older Delphi versions.

I need to try to find out which older Delphi versions it supports.

–jeroen

via:¬†[WayBack] For once, I remembered …\Studio\19.0\bin\migrationtool.exe and imported all the IDE tweaks and color settings I had… – Lars Fosdal – Google+

Read the rest of this entry »

Posted in Delphi, Development, Software Development | 4 Comments »

 
%d bloggers like this: