This repository has been archived on 2024-08-23. You can view files and clone it, but cannot push or open issues or pull requests.
project/sql/get_top_level_folder.sql

26 lines
430 B
MySQL
Raw Normal View History

2024-07-30 14:40:09 +00:00
WITH
permitted as (
SELECT
folder_id
FROM
permissions
WHERE
user_id = $1
)
SELECT
2024-08-09 14:02:02 +00:00
folder_id, owner_id, folder_name, created_at
2024-07-30 14:40:09 +00:00
FROM
folders
WHERE
folder_id IN (
SELECT
folder_id
FROM
permitted
)
AND parent_folder_id NOT IN (
SELECT
folder_id
FROM
permitted
)