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

18 lines
348 B
MySQL
Raw Normal View History

2024-07-31 09:30:18 +00:00
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
)