MYSQL里有没有像PHP里面的explode函数解决方法
MYSQL里有没有像PHP里面的explode函数
请教
------解决方案--------------------
给你一个我写的存储过程的例子,里面有你想要的。
DELIMITER $$
DROP PROCEDURE IF EXISTS `sp_get_new_release`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_get_new_release`(IN var_str varchar(20),
IN var_note_language char(5))
BEGIN
DECLARE cnt int;
DECLARE i int;
SET @curs = var_str;
SET @op = " ' ";
SET @cur_lang = 'en ';
SET @full_version = ' ';
SET @sql = 'SELECT * FROM software_release a WHERE 1 = 1 ';
SELECT COUNT(*) FROM software_release WHERE STRCMP(note_language,var_note_language) = 0 INTO cnt;
IF cnt != 0 THEN
SET @sql = CONCAT(@sql, ' AND STRCMP(a.note_language, ',@op,var_note_language,@op, ') = 0 ');
ELSE
SET @sql = CONCAT(@sql, ' AND STRCMP(a.note_language, ',@op,@cur_lang,@op, ') = 0 ');
END IF;
loop1:LOOP
SET i = LOCATE( '. ',@curs,1);
SET @a = LEFT(@curs,i-1);
SET @full_version = CONCAT(@full_version,REPEAT( '0 ',(4 - LENGTH(@a))),@a);
SET @curs = SUBSTR(@curs,i+1);
IF INSTR(@curs, '. ') = 0 THEN
SET @a = @curs;
SET @full_version = CONCAT(@full_version,REPEAT( '0 ',(4 - LENGTH(@a))),@a);
LEAVE loop1;
END IF;
END LOOP loop1;
SET @sql = CONCAT(@sql, ' AND full_version > = ',@op,@full_version,@op);
PREPARE s1 FROM @sql;
EXECUTE s1;
DEALLOCATE PREPARE s1;
END$$
DELIMITER ;

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

System76 has made waves recently with its Cosmic desktop environment, which is slated to launch with the next major alpha build of Pop!_OS on August 8. However, a recent post on X by System76 CEO, Carl Richell, has tipped that the Cosmic DE developer

Methods to delete elements: 1. Use delete() to delete the specified element from the Set object, the syntax is "setObj.delete(value);"; 2. Use clear() to delete all elements in the Set object, the syntax is "setObj.delete(value);" "setObj.clear();".

This article is based on the basics of Python and introduces how to use dict and set. The dict using the key-value storage structure is very useful in Python. It is important to choose an immutable object as the key. The most commonly used key is a string.

Preface There are two very similar methods in the commonly used collection interface List in Java: Eset(intindex,Eelement); voidadd(intindex,Eelement); both of these methods insert specified elements at specified positions in the collection, then What is the difference between these two methods? Next, let’s take a look at the differences and similarities between these two methods through ArrayList, our commonly used collection implementation. First, let’s take a look at the similarities between these two methods in ArrayList. They will insert new elements at specified positions in the collection, such as the following Example: #Insert an F in the 2nd position of the collection #Insert Listlist= through the add method

1. Overview of the Map Collection Framework The Map collection framework is a key-value pair data structure that allows you to use keys to find and store values. Each key in the Map is unique and can only be associated with one value. Common implementations in the Map collection framework include HashMap, TreeMap and LinkedHashMap. 1.HashMapHashMap is the most widely used Map implementation in Java. It stores data based on hash tables. HashMap has excellent performance, and the time complexity of search and insertion operations is O(1), but it does not guarantee the order of elements. Demo code: Mapmap=newHashMap

The set command syntax SETkeyid[FIELDnamevalue...][EXseconds][NX|XX](OBJECTgeojson)|(POINTlatlonz)|(BOUNDSminlatminlonmaxlatmaxlon)|(HASHgeohash)|(STRINGvalue) The set command is equivalent to the use of the hash command in redis. It is also a combination of key and id, but the difference is that Tile38's set command can also carry more other attributes, such as customizing the FIELD field, setting the EX validity period, etc., then we need to

1.ListList is an ordered collection in the Java collection framework that allows elements to be repeated and elements can be accessed by index. Common implementation classes of List include ArrayList, LinkedList and Vector. The following demonstrates how to use ArrayList to store a set of integers: importjava.util.ArrayList;publicclassArrayListDemo{publicstaticvoidmain(String[]args){//Create an ArrayList object ArrayListnumbers=newArr
