I have 4 tables as shown below For each table I want the count of users that are present exclusively in that table (not present in other tables). The result should look something likes this I have one way of getting desired result as shown below: First Column: Second Column: Third Column: Fourth Column: But I…
PostgreSQL – Get count of items in a table grouped by a datetime column for N intervals
I have a User table, where there are the following fields. | id | created_at | username | I want to filter this table so that I can get the number of users who have been created in a datetime range, …
Is there a way to load multiple values of one column into new lines to a single row in sql
This is how my data looks, emp_id,skills 1234,python|java|sql|R|javascript 5639,C|HTML|php|perl This is how data need to be loaded into the table emp_id skills python 1234 java …
LEFT JOIN but take only one row from right side
Context: I have two tables: ks__dokument and ks_pz. It’s one-to-many relation where records from ks__dokument may have multiple records assigned from ks_pz. Goal: I want to show every row from …
Using BETWEEN in native query in JPQL
I tried to make a query using BETWEEN in JPQL, I already tested it in SQL and it works, but when I implemented in JPQL I got an error: Caused by: javax.persistence.PersistenceException: Exception […
how to check a date is in current financial year
I am trying to check a condition if given date is in current financial year i.e april to march. but not getting any idea how to do code select nvl(Count(1), 0)+1 from ASET where IPE=’O’ and irt in (…
Develop a single host multiple client MYSQL database
Please forgive me if the title is not correct. I am still trying to understand how this works. I have installed MySQL workbench and the MySQL server on my laptop. I have successfully created a database that store driver details, as per the picture. I can access this info only one my laptop. However, I would a…
How to map/join two tables and filter by parameters using dapper
I want to join two tables that have a relationship with each other, In the Customer table, there are two columns for deleted and approved. Get the Customer that are approved and not deleted then match the Customer with the Loan table Using CustId (Both Tables has CustId) and Filter by supplied parameters Dele…
How to make an SQL query to get only 1 row with specific data?
I have the following MySQL query: SELECT work_from, work_until, restaurant_id, from_date, to_date FROM restaurant_working_times WHERE restaurant_id = ? and restaurant_id is not null and `week_day` …
SQL query on multiple columns and sort
I have two tables and the ZIP code is a field. If I want to get the top 10 in each table, I use the following command. select ZIP, count(*) from tab37 group by ZIP order by count(*) desc limit 10 …