Skip to content

SQL query in Java with enum return error of Incorrect integer value:

I get this error massage: java.sql.SQLException: Incorrect integer value: ‘xACxEDx00x05~rx00… the query is working, but if I put the category name (Category.Electricity) its return error. I call it with statement.setObject(…) meybe this is wrong..? the main class: the enum class: the method:…

INNER JOIN twice form the same table

I have 2 database tables that I want to JOIN. DB table 1 had football fixtures in it. So Team A plays Team B and the score was. The data comes from an API and in this DB table the teams are numbers instead of actual names. In the second DB table I have a list of all the teams

SQL Server: join data but in single row

I have a table Invoice that looks similar to this: order_id completed_at subtotal discount_amount handling_amount 100 07/01/2021 10.09 0 0 101 07/04/2021 200.30 0 0 102 07/04/2021 54.10 0 0 103 07/06/2021 12.00 0 0 And I have another table InvoiceDetail: order_id product_id qty amount 100 1234 1 1.09 100 Ship…

ActiveRecord having count query condition

I have 2 models : Conversation and Message I need to retrieve all conversations that belongs to a Brand and where there are at least one message from the brand and one message from an influencer This is my query : But i get conversations that doesn’t have messages from both… What am i doing wrong …