tsql icon indicating copy to clipboard operation
tsql copied to clipboard

Investigate SQLite bug where parenthesized subquery is treated as scalar

Open AnyhowStep opened this issue 5 years ago • 1 comments
trafficstars

https://www.db-fiddle.com/f/9nFfo6iRzeD3kcvFJHFF5R/1

This query,

SELECT 1e0 IN(
  (SELECT value FROM myTable)
);

Is not the same as this query,

SELECT 1e0 IN(
  SELECT value FROM myTable
);

They're the same on MySQL and PostgreSQL, but not SQLite.

AnyhowStep avatar Feb 03 '20 01:02 AnyhowStep

I can only assume SQLite thinks a parenthesized subquery is a scalar value, even if it fetches more than one row.

AnyhowStep avatar Feb 03 '20 01:02 AnyhowStep