sql icon indicating copy to clipboard operation
sql copied to clipboard

Subquery seem to fail though accepted by sqlite3.

Open lcaballero opened this issue 1 year ago • 1 comments

Hi, I think this is a bug, but I'm not terribly familiar with this library and sql derivative.

This sql query:

SELECT
  count(),
  'user without role',
  id
FROM
  user as u
WHERE
  u.id
NOT IN (
  SELECT user_id
  FROM mm_user_access_role
)
;

But produces this error:

err: 11:3: expected expression, found 'SELECT'

lcaballero avatar Jun 15 '23 01:06 lcaballero

Here is a different example, but I believe it has the same root cause

SELECT column1,
       CASE
           WHEN column2 > 50
               THEN (SELECT column3
                     FROM bokume
                     WHERE id = fokume.id)
           ELSE 'value'
           END
FROM fokume;

prochac avatar Jun 02 '24 22:06 prochac