I searching since a week for this problem. I try many code and I’m not able to get a correct answer, here’s the problem : I have a table of seller that have each time a customer contact this seller, …
Tag: select
Query through PreparedStatement in H2 throws exception: This method is not allowed for a prepared statement; use a regular statement instead
A simple query fails when run through a prepared statement while using JDBC 4 to access an H2 database in Java 11. When running this line: try ( ResultSet rs = pstmt.executeQuery( sql ) ; ) { …I …
Oracle SQL: How to write below SQL in Oracle
There is a table t1: Now I need to check if the id only has type a and the count is 1 (single), i.e., only id 4 satisfies this condition in the data above I use the above SQL query to get the data and then use it in code. It’s not a good solution, can anyone help me to
SQL Order by 2 conditions
Let’s say that I have a database, that looks like that: price date hour 12.00 2018-12-11 5 13.00 2018-12-04 2 14.00 2018-12-06 1 15.00 2018-12-11 1 16.00 2018-…
sql (oracle) count and sum within the same select/where query
With reference to the following and correctly answered question: sql (oracle) counting number of overlapping intervals Given the following table test in an oracle sql database: +—-+——+——-+-…
Calculate proportion (percent) [closed]
Could you help me to calculate proportion of Table user_id attendance Date 1 1 01.01.2018 2 Null 01.01.2018 3 1 02.01.2018 4 …
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, …
How to write SQL for combination of AND?
Please check the attached table. I need to write a query to get documents which have both tage_id of say 32 and 26. Something like select * from doc_tags where tag_id = 32 or tag_id = 26 is not going to work as I will get both documents with 32, 26, and ( 32, 26 ). I need documents which
Display all Dates in a given month and year in firebird select procedure
I am making a program for Time and Attendance. I have a table with this fields here is the sample data and my desired output is this the time format of my desired output and my data is different and display the complete dates of the given month and year Answer You could solve this problem with a selectable stored
SQL – return each column and it’s sum as rows
I have a table like this: date | employee_id | field1 | field2 | field3 | … | fieldN I need a select which will return something like: field1 | SUM(field1) field2 | SUM(field2) field3 | SUM(…