Skip to content

Tag: firebird

Fetch most recent value – sql execution time too long

I have a Firebird database with a table with two columns: Date and value. I want to get the most recent value. Problem is, that this table can have easily over 200k rows. My select query takes more than 400ms, which is just to long for my application. Is there any way, I can speed this up? I can’t chang…

Combining 2 queries in 1 (select based on other select)

I have 2 queries: and second one base on first one They work nice, but I need them to work as a one combined query, result from access looks like this: But this gives me only empty table. Can you help me? Answer Your inner join depends on the right-hand-side table of the left join, this effectively converts t…

Building complex SQL command

I am using sql for select, update, insert and some other features, but only simple ones until now. Now I need to write a complex command. I have looked at using case but I do not know how to implement it. This is what it should look like: I used ~TACNO~ to point out where I need a conditional value.

How to check if a column is being updated

Let’s suppose I have an instruction that does the following: Is there any way to do it in Firebird, the same thing as Oracle does … The trigger would only be executed if it had only only updating the “active” column. I tried that way, but it’s not working: Answer Firebird doesn&#…

Firebird with .net driver – drop table if exists

I’m new to Firebird and I’m testing a few things to check out the differences between Fb and SQlite (and the .net driver). I am trying to do a drop table if exists followed by the creation of a table. In Sqlite I am able to do this by: However in Firebird the same query fails. I’ve read that…