Skip to content

Instantly share code, notes, and snippets.

@slpsys
Created April 22, 2011 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slpsys/935788 to your computer and use it in GitHub Desktop.
Save slpsys/935788 to your computer and use it in GitHub Desktop.
fuuuuuuu-mysql.sql
-- This is T-SQL (SQL Server). This demonstrates two things MySQL can't do that I just ran into.
DECLARE @a TABLE
(
id int
)
DECLARE @b TABLE
(
id int,
name nvarchar(10),
fid int
)
insert into @a (id) values (1)
insert into @b (id, name, fid) values (1, 'Test', 1)
delete from @a where id in
(
select [@a].id from @a
inner join @b
on [@b].fid = [@a].id
)
select COUNT(*) from @a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment