Skip to content
Advertisement

Tag: variables

Slow sql statement when using variables

I have the following SQL statement running against a MariaDB 10.1.26 with ~2.000 rows with instant results. When I use the following statement with variables for the datetime fields, the execution takes ~5.5 seconds. The more data rows I have, the longer it takes to execute the statement. Seems like the variables change the behaviour of the statement somehow. What’s

PL/SQL fill variable with if-condition value

i am trying to fill a variable in PL/SQL with an if-condition value like this: v_variable := if(4 > 3) THEN ‘A’ ELSE ‘B’ END; but this doesnt work. Are there any options to do this? Answer Instead of doing this with an if, I’d go with case:

Advertisement