icp29
Ivan Carreras   Mahon, Islas Baleares, Spain
 
 
Girador de esquinas profesional
Currently Offline
Rarest Achievement Showcase
Comments
ZTommy 25 May, 2023 @ 12:10pm 
BEGIN
DECLARE overlapping_count INT;

SET overlapping_count = (
SELECT COUNT(*)
FROM reservation
WHERE room_id = NEW.room_id
AND date_out >= NEW.date_in
AND date_in <= NEW.date_out
);

IF overlapping_count > 0 THEN
-- Without that the mesage dont work
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Selected room is not available for the specified dates.';
END IF;
END
icp29 8 Mar, 2023 @ 2:53am 
(SELECT customer_id
FROM `order`
WHERE quantity>=3;)

Y no funciona
balariash 21 Nov, 2022 @ 12:01pm 
A ver si me dan el logro