When using the JOOQ MockDataProvider what is the correct way to build a MockResult for stored procedures? The examples I’ve found show how to return results for tables and views by creating a result and record from generated table definitions and then returning them. For stored procedures I’m not …
Tag: sql
Is it possible to join a table to itself
I have a query that joins two tables together. In table O I have an employee ID, which I join to the HR table to retrieve the employee name: inner join hr AS hr on o.syscreator = hr.res_id Also on …
Select values from one column which share a value in another column
Here is the problem. The database describes symmetrical and transferable relations between objects (genes from different species). If a gene X from species 1 is in relation to gene Y from species 2, …
How formulate a SQL query that needs to mention four different tables?
I want to get the Company name and all the products they purchased in a single SQL query. The database used is the Northwind sample database. The relations between these columns and dbs’ tables look …
SQL Select after character /
I’d like to select everything AFTER a certain character (/) that is placed on the most right side. I’v in CSV_COL(3) this text 200/100 or 50/10 ot 10/5 etc.. and i need to uso only number to the …
How to write a query that retrieves 3 replies for each user in my users table?
i want to display three replies from each user i have in my users table, so for instance if i have 3 users and each of them had replied to lets say 10 messages, i want my query to only retrieve 9 …
Select items with the same foreign key
I have a question regarding Linq in C#. Let’s say that I have 3 tables “Company”, “Employee” and “Job”. Company ——– Id – int (PK) Name – string Employee ——– Id – int (PK) CompanyId – int …
Group by to include case statement inside SQL statement
I have a table which stores purchase info from sellers and table contains rating to every purchase out of 5 stars. I want to have output Group By sellers and Each sellers good(Above 3) and bad(Below 4)…
Postgres, aggregate result to a single row using values from a column
In Postgres, I am trying to aggregate results from a table that looks like this: id restaurant_id title category ————————————————- 1 2 …
Access SQL JOIN with subquery
Can someone tell me how I can convert this query to work in MS Access? SELECT Shooters.idShooters, Shooters.firstname, Shooters.lastname, JoinedContingent.Count, JoinedShots.Count FROM Shooters …