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 1,860 other subscribers

MySQL: Row Literals | Die wunderbare Welt von Isotopp

Posted by jpluimers on 2025/01/07

For my link archive: [Wayback/Archive] MySQL: Row Literals | Die wunderbare Welt von Isotopp

Question on the Libera/#mysql IRC channel:
Is there a way to split a simple select into multiple returned rows? For example, select 1, 2, 3 to be returned as rows?
This is actually asking for a table literal notation. I know of four ways to construct a table literal in MySQL:

They are based on UNION ALL, JSON_TABLE and VALUES statement (the latter in two forms). I knew about the first (which I used in other database environments), not about the others.

Via: [Wayback/Archive] Kris on Twitter: “How can you define a table literal in MySQL 8? Four ways to do it:” threaded at [Wayback/Archive] Thread by @isotopp on Thread Reader App.

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.