Raised This Month: $51 Target: $400
 12% 

[MySQL] IF WHERE conditions correct syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-09-2020 , 22:07   [MySQL] IF WHERE conditions correct syntax
Reply With Quote #1

Hi,

help me please compile correct mysql syntax.

I tried:

Code:
ALTER TABLE `l4d2_stats_test` ADD COLUMN `Dummy` int(11) NOT NULL DEFAULT '0' AFTER `Boomer`
WHERE (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'l4d2_stats_test' AND column_name = 'Dummy') = 0;
and

Code:
IF (
  0 = (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'l4d2_stats_test' AND column_name = 'Boomer')
)
begin
  ALTER TABLE `l4d2_stats_test` ADD COLUMN `Dummy` int(11) NOT NULL DEFAULT '0' AFTER `Boomer`;
end;
both unsuccessful (incorrect syntax).

Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode