Skip to content

Instantly share code, notes, and snippets.

@gabrielgilini
Created January 3, 2012 18:14
Show Gist options
  • Select an option

  • Save gabrielgilini/1556143 to your computer and use it in GitHub Desktop.

Select an option

Save gabrielgilini/1556143 to your computer and use it in GitHub Desktop.
Example of non-working code
DELIMITER //
CREATE PROCEDURE p1()
BEGIN
DECLARE ids INT;
SELECT id FROM t4 WHERE t5_id = 8 INTO @ids;
SELECT
t3.*
FROM
t1
INNER JOIN t2 ON t2.t1_id = t1.id
INNER JOIN t3 ON t3.id = t1.t3_id
WHERE
t2.t4_id IN (@ids);
END;
//
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment