Created
April 22, 2011 00:43
-
-
Save slpsys/935788 to your computer and use it in GitHub Desktop.
fuuuuuuu-mysql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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