skip to Main Content

Mysql convert FLOAT to DECIMAL

I have mysql DB with important financial data, currently the data is stored as float type and I get incorrect data due to float rounding, I want to store it as DECIMAL. What is the safe way to convert the…

VIEW QUESTION

Mysql – How to exclude all rows from query where is a single item that costs less than 10

For my assessment I have to obtain such result from mysql database: +---------------------------------------+---------------------------------------+-------+ | name | name | item | +---------------------------------------+---------------------------------------+-------+ | Krispy Kreme - Edinburgh Lothian Road | 6 Assorted Doughnuts | 12.95 | | Krispy Kreme - Edinburgh…

VIEW QUESTION

php mysql multiple table search

I have two tables Table products : product_id,name,barcode1,barcode2,barcode3 Table more_barcodes: product_id,barcode How to join those two tables when user search barcode ? select products.* from products LEFT JOIN more_barcodes ON products.product_id=more_barcodes.product_id where ( (products.barcode1 LIKE '%$user_search%') OR (products.barcode2 LIKE '%$user_search%'…

VIEW QUESTION

MySQL index does not work if I select all fields

I have a simple table like this, CREATE TABLE `domain` ( `id` varchar(191) NOT NULL, `time` bigint(20) DEFAULT NULL, `task_id` bigint(20) DEFAULT NULL, `name` varchar(512) DEFAULT NULL PRIMARY KEY (`id`), KEY `idx_domain_time` (`time`), KEY `idx_domain_task_id` (`task_id`), FULLTEXT KEY `idx_domain_name` (`name`),…

VIEW QUESTION
Back To Top
Search