How to write below query in Laravel
I have a table and there are two columns. user_id to_user_id 101 102 102 101 101 105 In the above table, 1 and 2 rows of users are like each other I want to remove 2 rows. Here is my…
I have a table and there are two columns. user_id to_user_id 101 102 102 101 101 105 In the above table, 1 and 2 rows of users are like each other I want to remove 2 rows. Here is my…
i'm working on a project which has a simple dashboard, on my server i make three mySql connections and get some information like ( users, admins ,events ) which will be shown on the dashboard, i use this code to…
I'm running a count query which is very slow, how can improve this? I've got the following query, but it takes around 1.33 seconds: select count(*) as aggregate from `tickets` inner join `orders` on `orders`.`id` = `tickets`.`order_id` where `orders`.`status` =…
I have the following mysql regex: REGEXP '-v[0-9]{1,2}' Which catches -v01 and -v1 and -v03 and -v97, I want to add a dot . at the end of it: -v01. and -v1. and -v03. and -v97. so that it only…
15 I have a table with ~80k rows with imported data. Table structure is as follows: order_line_items id order_id product_id quantity price uuid On import, the order_id, product_id, quantity, and price were imported, but the uuid field was left null.…
I am very new to the laravel subqueries , i am trying to fetch another table data but it's showing an following error SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the…
I am trying to execute a mysql command inside a bash script but every time I try to execute it fails for some reason. I have tried several ways and none seemed to work(e.g: <<QUERY...;QUERY) My select is the following…
Error Message You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%s' at line 1 MySQL Database Table CREATE TABLE `tblorders` ( `order_id` int(11)…
I want to display some statistics to users that entered a command and I'm using to different SQL queries for that. The first one: SELECT COUNT(*) FROM guild_finished_giveaways WHERE guild_id = {} AND winner_id LIKE '%750718563651944518%' I want to get…
I have the same issue listed in this SO question, but I have tried the solution and I am getting a SQL error 1288- I'm thinking I am poorly translating SQL server to SQL or this method has been deprecated.…