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.
Getting all weeks data of a month using inner join
I have the following query: Above query explanation: I’m getting all weeks data PaidKM which driver gets in a whole month. The month for example starting date is 01-07-2018 and ending date is 31-07-2018 which covers whole month # 07. But when I change the month it gives me the same results all time. Abo…
Subquery Returns Muiltiple Values, but I am using “IN” as my operator
Long story short, I have a Crosswalk table that has a column name MgrFilterRacf. There is a single line in the table I use to reference various things across a few queries, this method has worked fine …
Error in Firebird Procedure
I have to do one query to get one parameter (I need a “1”), but this parameter can be in different cells, for example: +————–+————–+————–+ |….cell1…..|…..cell2….|……
Why did I sum the wrong result?
I’d like to have an advice for this SUM that doesn’t work as expected. I have to SUM data from the same day and display it in a table. I did a query like this: This is the ‘simple’ one and it displays every single row, I have to put a SUM in it to make it show every day
Multiple joins in SQL statement
To clear things up, I have two tables, employees and jobs. In employees I have columns firstname, lastname, employees id. In jobs I have columns job_id, job_name, job_description, job_opener, …
SUM of columns duplicates
I have table as below DATE | JOB_ID |Name | Count ——————–|———–|———–|——– 01-JAN-18 01:02:41 | JOB_1 | weight | 200 01-JAN-18 01:02:41 | …
Postgresql, retrieve value for specific key from json array
I have Postgres JSONB array of objects, looking like this : This JSONB is a function argument. What is the most efficient way to retrieve skillLevel for skillId = “1”. I’ve tried to play with jsonb_array_elements but everything I’ve done so far is looking really messy. Answer In Postgr…
Copying tables from one database to another, in Firebird 2.1
I need to copy tables from one database to another in Firebird 2.1, but in some way which is pretty quick and you can run this on console. I used FBcopy but get the answer from boss that it is too slow. This must be done in more than one transaction because tables are quite big. Any ideas how I
Oracle 12 SQL – ORA-00933, ORA-0923, ORA-00979 What am I doing wrong?
I am currently facing a bit of a wall, I am attempting to take information from two different tables, have them displayed side by side with the information recording by count. One being the total …