From 96a7da41d70375299567786c6e73534af4339185 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 11 Oct 2016 11:04:58 +0800 Subject: [PATCH] MOVED mysql/company_get_owner.sql to mysql/core_company_get_owner.sql --- mysql/core_company_get_owner.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 mysql/core_company_get_owner.sql diff --git a/mysql/core_company_get_owner.sql b/mysql/core_company_get_owner.sql new file mode 100644 index 00000000..29004bbd --- /dev/null +++ b/mysql/core_company_get_owner.sql @@ -0,0 +1,12 @@ +DROP FUNCTION IF EXISTS company_get_owner; + +DELIMITER $$ +CREATE FUNCTION company_get_owner() RETURNS INT(11) DETERMINISTIC + BEGIN + DECLARE v_id INT(11); + SET v_id = 0; + SELECT id INTO v_id FROM Companies WHERE isOwner = 1 LIMIT 1; + RETURN v_id; + END $$ +DELIMITER ; + -- 2.39.2