New answers tagged

0

A couple of comments: Re: "the standard linux-user-name-matches-the-mysql-account-name authentication" - I assume you mean using the unix_socket plugin for authentication. This only works on localhost, i.e. the user has to be logged in on the database server. There is no MariaDB 5.7, but there is however a MySQL 5.7. There is no need to build your own RPM ...


1

SELECT * FROM ( full text of query 1 ) WHERE (condition 1) UNION ALL SELECT * FROM ( full text of query 2 ) WHERE (condition 2) AND NOT (condition 1) Neither condition must give NULL (due to NULL in field/variable values) in NOT. Outer SELECTs for each separate subquery in UNION may be excess if separate queries are not complex. For the code shown in ...


0

Don't compare a VARCHAR to a numeric literal. It cannot use an index. Either change session to BIGINT or add quotes to the comparison: AND session = '1564752045544' INDEX(session) PRIMARY KEY(amount, session, win_digit) -- if it is unique Simplify the "RIGHT" tests. I think the 3 OR items can be changed to simply AND `user_given_numbers`.`input_digit` =...


0

SP can be like (draft code): CREATE PROCEDURE DeleteFromGeneralLogs (IN DeleteTill DATETIME) BEGIN DECLARE done INT DEFAULT 0; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done:=1; -- IF DeleteTill IS NULL THEN LEAVE; WHILE done = 0 DO SELECT SLEEP(1) INTO done; -- small pause between chunks DELETE FROM customer.generallogs WHERE ...


1

This is yet another installment of the MySQL sql_mode = only_full_group_by saga. <rant> The problem is that MySQL's default (till 8) will return results which, depending on the order of the records being INSERTed into the table (and/or PRIMARY KEY ordering), will vary and be correct or wrong DEPENDING. This is absolutely the worst sort of difficult to ...


0

SELECT distinct MEMB.LAST_M LAST_M ,PrintDate as PrintDate FROM MEMB LEFT JOIN tblPrint ON MEMB.MEMB_N = tblPrint.MEMB_N group by MEMB.LAST_M ORDER BY PrintDate DESC;


-1

Create a new index that is based on movido,status, id_empresa, referencia, archivo To convert the query to a covering index


Top 50 recent answers are included