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/name_exists.sql
2024-07-31 12:30:18 +03:00

18 lines
348 B
SQL

SELECT
EXISTS (
SELECT
file_name as name
FROM
files
WHERE
folder_id = $1
AND file_name = $2
UNION
SELECT
folder_name as name
FROM
folders
WHERE
parent_folder_id = $1
AND folder_name = $2
)