php - Possible to order an SQL query that matches with a REGEX by the number of matches found? -
I am using a SQL query such as Now all this works very well, but orders are not ordered based on the number of matches of my results, which is what I see. Thanks Full Query `` `` `` `` `` `` `` `` `` ] '' Or (`item` .`name` regxp '[[:: & lt ;:]] world [[: & gt;:]]') The user is prepared on the basis of input, in each place it divides into a different part that is searched. I would like to order results based on the number of matches of all parts, thus the most relevant results are on top There was also a solution to the Nifty. WHERE name REGEXP '[[: & lt ;:] ] Some [[:: & gt ;:]] '.
Select Item.
DELIMITER // CREATE DEFINER = `Route` @ 'localhost' function 'substrate number' (SVARAR (255), SS VAARAR (255)) Return tint (3) unsigned SQL data The redirection starts is calculated from the tinnitus (3), DECLARE offset TINYINT (3) Uncredited; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET s = NULL; Set count = 0; Set offset = 1; Repeat if ISNULL (s) and offset & gt; 0 then offset = location (ss, s, offset); If Offset & gt; 0 set count = count + 1; Set offset = offset + 1; end if; end if; ISNULL (s) or offset = 0 until repeat the end; Return calculation; END DELIMITER;
Comments
Post a Comment