I have three tables and would like to answer the following question in SQL: “Who has only certifications that do NOT have scores?” For instance, in the setup below, the query would return “John” only. Joana has the “AWS Certification”, which is in SCORE table (id 57). Marry has the “ITIL V3 Certification” which is not in the SCORE table,
Tag: database
Few issues Inserting and filtering XML data to SQL
I’m having a few issues when inserting data from a XML file to a SQL Server database. How can I get the file name dynamically? This file is put on that path with a different number every time but always starts with Idoc and it’s a .xml file. I’m having troubles setting a variable inside OPENROWSET. At the moment I’m
How to make POSTGRESQL query based on first 2 parameters and latest third parameter
I have DB: I need to make query request for last year(or last 12 months) group by Client_id, Version and latest date(!) for them. For example: This is what I have right now: And I’m getting result for EVERY DAY. If I’m removing DATE from group by, its complaining that Date should be in Group by. I hope I did
How to check against a DB Table in Mapforce?
The question is about mapping in Mapforce. I have an Excel input file. I also have a table from Oracle DB. What I want to do is the following: Take tournr from Excel and compare it to tournr in Table from DB. When there is a match, take NR column from DB table. How can I do that? Answer I
When you give a table a name are you temporarily cloning it? (MySQL)
It’s a common question: Write an SQL query to delete all the duplicate emails, keeping only one unique email with the smallest id. Example 1: Input: Person table: Output: I know that to select what I don’t want, I have to do something like this: After that portion I got stuck, so I looked at the answer: Where I get
Missing query data when using Sum
My database in Microsoft Access looks like this: Every Client can have many assistants. Every Assistant may have one client or no clients at all. Assistant have a Nice field which is Boolean, indicating whether the Assistant is nice. I need a query where I can get all of the clients, together with a boolean value indicating whether they have
Creating new column from existing column with condition SQL
I need help with one table name as Employee. Table employee consist of four columns “ID” “salary”, “position” and “cumulative_salary” . Position consist of senior and junior status and there salary are in different range. I want to add another column from salary column named as “salary_range”. Now condition for my salary range column is if someone salary lies between
Database row wont update when my TRIGGER fires. — “#1242 – Subquery returns more than 1 row”
I want to insert a new row on table ‘b’ when a column in table ‘a’ is updated. But when the trigger fires with UPDATE REQ SET status=’approved’ WHERE idReq=1; it throws an error saying: “#1242 – Subquery returns more than 1 row” Note: I am using MariaDB 🙂 Here is my TRIGGER: Answer My assumption reading your code is
FULL OUTER JOIN (or UNION) on 2 tables
I’m facing a SQL request issue. I’m not a SQL expert and I would like to understand my mistakes. My use case is to get all records of the first table + records of the second table that are not present in the first table. I’ve got 2 tables like this : First table “T-Finance par jalon ZOHO” (with 20
What query will return consumption per hour from SQLite data with cumulative value?
Firstly, I am almost a complete novice when it comes to SQL, so I am painfully aware I probably need to be spoon-fed anything but the simplest queries. I have been searching a lot, but most relevant examples I find seem to be too complex or general to help me with my problem. I have the following table in a