To extract the week of a given year we can use: However, I am trying to group weeks together in a bit of an odd format. My start of a week would begin on Mondays at 4am and would conclude the following Monday at 3:59:59am. Ideally, I would like to create a query that provides a start and end date,
How to search for for strings/keywords in Access database using PHP?
I’m working on a school assignment and I’ve an Access database which has a memo field that stores lots of text. I wanna know how I can search for specific keywords in that memo field. For instance, …
Find records which cross-reference each other
I want to extract all the rows from a database table, where the rows cross-reference each other. My table contains 2 rows: ref1 & ref2 Table example: In this case, I want my query to return only rows 01 and 03, because they cross-reference each other. Is this possible using a single query, or will I need …
SQL Update if parameter is not null or empty
I searched some ways to check if a SQL Server parameter is not null or empty but I’m not sure what’s the best way to use this when updating several columns: I had this code at first that was updating without checking for empty or Null values: Then I added an IF clause before updating, it is workin…
Stackoverflow with Hibernate using sql IN (id, id, id, id..id)
I am getting the error below saying there was a stack overflow. This is happening because a SQL statement with IN (id, id, id…id) has a ton of parameters. Is there anyway to fix this? This is happening in my local environment with Eclipse. JPA Error Hibernate Query Answer In our Grails project (2.3.6) w…
How to allow only one row for a table?
I have one table in which I would like only one entry. So if someone is trying to insert another row it shouldn’t be allowed, only after someone deleted the previously existing row. How do I set a rule for a table like this? Answer A UNIQUE constraint allows multiple rows with NULL values, because two N…
Passing a non-column parameter in a MyBatis ResultMap to a nested select
I’ve a One-to-Many relationship in my domain model where I basically want to read Foos and a filtered set of Bars with one MyBatis select statement using a nested select for the Bars. To explain: My domain model classes look more or less like this (the real domain model is more complex of course, but my…
mySql database – ID auto_increment : what are the risks of it?
I´m kind of new to databases and I was hoping you could answer my question: I have a table with an ID that´s a primary key, not null and Auto increments. It´s data type is int, with a limit of 50 digits. this table will be receiving new rows constantly, so I was wondering if it´s dangerous to leave as
Update row with select on same table
I’m trying to update row with same table query. Context: I want to : For each row; if TEXT IS NULL; update it with TEXT value of row with same ID and LANG = ‘EN’. What is the SQL request to do something like that ? Answer You don’t specify the database. The following is standard SQL: I…
There is insufficient system memory in resource pool ‘default’ to run this query. on sql
I have a running service that gets 50-100 queries per minute. And these are not high cost queries. This service has been running for around 3-4 months without any errors. Suddenly few days ago it started giving “There is insufficient system memory in resource pool ‘default’ to run this query…