select count(test) from table where exists (select test from table)
How to select based on the condition of a column exists? It column test is not exists, a message need to be returned.
You have to query the system catalog (or information schema) for the absence of an expected row. Otherwise the only message you will end up returning is "column not found" since you cannot write and execute an SQL query without knowing and defining its entire structure.
Alternatively, you write a function with an exception block.
David J.
Есть вопросы? Напишите нам!
✖
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера