uhm sql help please, how to insert a row only when a condition is met, yes i am new fag, fuck my ass please
Please halp
Other urls found in this thread:
PM'd you the solution :)
Not possible. You'll have to do that in your program's logic.
There may be some retard way like causing an error when a condition is met, but that doesn't count.
Insert row(s) from a Select statement result. Have the condition inside statement
Type in DROP ALL DATABASES then learn how to use the catalog.
Uhhhhhh WHERE condition = 'met' ?
how to select properly
tried did not work
1. Make dummy table
2. Insert 1 dummy row inside
Insert into real_table
Select ‘value1’, ‘value2’
From dummy_table
Where condition=‘met’
that depends on your conditions, table name(s), column names and what tables need to join
can it into triggers
can i make a trigger that only gets up when a field says yes
Nigger you need go back to w3schools.
blog.udemy.com
nibbas got query
i get "if" logics, what i dont understand is how to apply it to triggers
You don't want triggers, you don't want database functions, you want to do a simple INSERT ITO statement. See If your input is in cleartext, you could just use regular expressions (regex) in a text editor.
Triggers work just like regular, statements inside begin and end. I usually add when created tables you can always alter them but maybe search about them since you don't understand basics.
He could literally use a
IF ( condition ) THEN
INSERT INTO ...
END IF;
because its part of sql if that's all he needed. It sounds like he has no idea what triggers are and is trying to trigger a insert after a update/delete/whatever.
I think he has no idea of what he's doing. He can't even figure out how to use a WHERE clause ffs.
That's a good point.
I got it now, my bad, made it work with events, sorry b o i s
soryyy
>babby's first database trigger
It's all downhill from there, boy. I'll see you at the wizard reunion in fifteen years.
>he figured out how to use WHERE clause
Scratch this >never gonna make it