18 lines
348 B
MySQL
18 lines
348 B
MySQL
|
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
|
||
|
)
|