Mysql problem sets

[1] satisfy the following requirements

demand:

Implementation:

(1) re-live the King

SQL statement:

- [1] Remove the table 
the DROP  TABLE tbl_name;
 - [2] to create a table 
the CREATE  TABLE tbl_name (ID the INT , Msize VARCHAR ( 100 ));
 the INSERT  the INTO tbl_name the VALUES 
( 1 , ' Tiny, Small, Big ' ), 
( 2 , ' Small, Medium ' ), 
( . 3 , ' Tiny, Big ' );
 - [. 3] to create a table 
the SELECT  *  the FROM tbl_name;

FIG query data sets as follows:

(2) expected query result set

SQL statement:

SELECT a.ID, SUBSTRING_INDEX(SUBSTRING_INDEX(a.mSize, ',', b.help_topic_id+1), ',', -1) AS VALUE
FROM tbl_name a 
JOIN mysql.help_topic b 
ON b.help_topic_id < (LENGTH(a.mSize) - LENGTH(REPLACE(a.mSize, ',', '')) + 1)
ORDER BY a.ID;

The results set:

As described above.

[2] Issue 2 Continued

 

Good Good Study, Day Day Up.

Select the cycle order summary

 

Guess you like

Origin www.cnblogs.com/Braveliu/p/11454814.html