Mysql LIKE or REGEXP
I am trying to select all the strings has word ABC1 in it. But getting wrong answer with LIKE query. Not sure how to get exact answer. Below is the string format in a column: "SomeString ABC1000 Other"; And I…
I am trying to select all the strings has word ABC1 in it. But getting wrong answer with LIKE query. Not sure how to get exact answer. Below is the string format in a column: "SomeString ABC1000 Other"; And I…
I have two files. In table.php, I've implemented the display logic for data retrieved from our database. My objective within index.php is to include table.php while selectively filtering tickets based on their status, specifically, those with a status of "OPEN."…
I have two relevant tables in MySQL that look something like this: marker table id SEASONCD ITEMCD PRICETYPECD 1 foo bar baz 2 foo bar baz 3 foo bar baz 4 qux bar baz 5 qux bar baz 6 spam…
I have a database table with two columns updated_at and children_updated_at and I would like to show the latest modified records first based on the SQL function GREATEST(updated_at, children_updated_at). The SQL query I'd like to generate is: select * from…
Below is the database base snippet of the database that I am currently working on. Table transactions: id reference_table reference_field reference_id created_at 1 online_recharges online_recharge_id 10 2024-01-31 2 online_recharges online_recharge_id 11 2024-03-03 3 wallet_deductions wallet_deduction_id 10 2024-02-01 ... ... ...…
I got this in my homework and can't figure it out, please help. I have 3 tables: owners(id, name), breeds(id, type), dogs(id, ownerid, breedid) Connections: owners.id = dogs.ownerid AND breed.id = dogs.breedid My assignment is to find the the owners…
My goal is to periodically sync data between two databases. One is a "new" database which runs MySQL 8, the other is an "old" database that hasn't been fully decommissioned yet which runs MySQL 5. I want to sync in…
I have two tables, one that looks like this: The other has the countries' populations: I would like to sum up the revenue by country (I know how to do this part, e.g Select Sum(Revenue), Country from COMPANIES GROUP BY…
example I have the following string values '[123] X' '[123] Y' '[123] Z' ... I want to bulk change them to 'X [123]' 'Y [123]' 'Z [123]' ... X, Y, Z are completely random not sequential [123] is constant I…
I have Clocking table in database. I wanted to count the users' time spent per day. For example 2024-03-21, user 1 spend 6.8 hours, the next day he spends n number of hours and so on (['6.8', 'n', ... 'n'])…