Concatenate MySQL result (Join?)

I have the following MySQL tables: CREATE TABLE `person` ( `id` int NOT NULL AUTO_INCREMENT, `reference` varchar(100) NOT NULL, `email` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; INSERT INTO `person` (`id`, `reference`, `email`) VALUES (1, ‘PK001’, ‘paulk@gmail.com’); CREATE TABLE `review` ( `id` int NOT NULL AUTO_INCREMENT, `review_type` varchar(255) NOT NULL, `review_body` varchar(255)… Read More Concatenate MySQL result (Join?)

Find the matched rows based on redeem value in MySQL

I am implementing the cashback functionality with expiry feature. I am trying to redeem the partial amount based on early expiry date. I’ve already ordered the rows based on expiry date with the following mysql command. SELECT * FROM `cashback` WHERE `user_id` = 1 and `used`= ‘NO’ AND IF(CONCAT(`point_expiry`) !=’0000-00-00 00:00:00′, `point_expiry` >= NOW(), NOW())… Read More Find the matched rows based on redeem value in MySQL

mysql query to filter LIKE combined with IN

CREATE TABLE IF NOT EXISTS botPatterns ( `boltP` varchar(200) NOT NULL ) ; INSERT INTO `botPatterns` (`boltP`) VALUES (‘6X135/6X139.7’), (‘8X165.1’), (‘8X165.1/8X170’ ), (‘8X170’ ); CREATE TABLE IF NOT EXISTS Vehicles ( `Brand` varchar(200) NOT NULL, `Pattern` varchar(200) NOT NULL ) ; INSERT INTO `Vehicles` (`Brand`,`Pattern`) VALUES (‘Audi’,’6X135′), (‘Audi’,’8X165.1′), (‘BMW’,’8X170′ ), (‘Ford’,’9X139.7′ ); What I need… Read More mysql query to filter LIKE combined with IN

php/mysql phpmydamin server differances

Ok so Im using the following query SELECT `inquiry_source`.`source` AS ‘Source’, `inquiry_source`.`colour` AS ‘Colour’, SUM( CASE WHEN `inquiry_source`.`source` = `customer_migration_details`.`Acquisition_Source` THEN 1 ELSE 0 END ) AS ‘count’ FROM `inquiry_source` JOIN `customer_migration_details` ON `customer_migration_details`.`Acquisition_Source` = `inquiry_source`.`source` WHERE `date_opened` = ‘2023-01-23’ AND `Acquisition_Source` != ” GROUP BY `Acquisition_Source` Which in phpMyAdmin show the following results Source… Read More php/mysql phpmydamin server differances

3 tables sql sum divided by a minus between two fields not working

I have 3 tables: formulario, viaverde and reparacoes. one of the fields is equal in all tables, called matricula, i’m trying to group every arithmetic operation to it. but i keep getting the error of matricula is ambiguous or synthax errors, how can i achieve this? i tried the following code: JOIN ( SELECT matricula,… Read More 3 tables sql sum divided by a minus between two fields not working

Mysql – unknown column in 'field list'

Getting Error Code: 1054. Unknown column ‘identification’ in ‘field list’ using this simple insert: insert into document (`title`, `patient_id`, `file_type`, `doc_type`, `identification`) values (‘VISA BLUE GRACE2.png’, ‘122’, ‘image/png’, ‘document’, ‘0’); Existing stackoverflow answers talk about using backticks vs. single / double quotes which I believe I’m doing correctly here. Omitting the column from the insert… Read More Mysql – unknown column in 'field list'