Tags: comma-expression LAN requires targe reg SQL stored Procedure Blog SelectOriginal:Https://blogs.oracle.com/aramamoo/entry/how_to_split_comma_separated_string_and_pass_to_in_clause_of_select_statement' Smith,allen,ward,jones ' is a collection of 4 values, and what needs to be handled in the stored procedure in order to achieve the effect of in (value 1, value 2, value 3, value 4);The following methods a
a valid pattern-matching rule expression, and the correct result is obtained after escaping with "//*" "//+ ".Instance: Public classStrSplit2 { Public Static voidMain (string[] args) {String orgstr= "A,b,c,d,e,f"; String[] RESULT1= Orgstr.split (","); String[] Result2= Orgstr.split (",", 4); for(intA = 0; A ) {System
First we create a comma-delimited string.CREATE TABLE Test (id int (6) NOT NULL auto_increment,primary KEY (ID), pname varchar (a) not null,pnum varchar (a) NOT null) ;Then insert the test data with a comma-delimitedINSERT into Test (pname,pnum) VALUES (' Product 1 ', ' 1,2,4 ');INSERT into Test (pname,pnum) VALUES (' Product 2 ', ' 2,4,7 ');INSERT into Test (pna
Topic:There is a string that conforms to the following characteristics ("Abcdef,acccd,eeee,aaaa,e3eeeee,sssss,"),Required to write a function (interface), output the following results1) The string is separated by commas, the two-dimensional array is formed, and the result is transmitted.2) The results of the two-dimensional array rows are also spread out.Please d
Query a comma-delimited field, you can use the String function Find_in_set ();Query a field in a database table (the value is displayed as a branch), you can use function in ().Today's work encountered a problem, is to use the Find_in_set () function to solve.The first part:Find_in_set () function usage,Query a comma-
First we create a comma-delimited string. CREATE TABLE Test (id int (6) NOT NULL auto_increment,primary KEY (ID), pname varchar (a) not null,pnum varchar (a) NOT null) ; Then insert the test data with a comma-delimited insert into test (pname,pnum) VALUES (' Product 1 ', ' 1
Tag:mysqlselect regular First we create a comma-delimited string. CREATE TABLE Test (id int (6) NOT NULL auto_increment,primary KEY (ID), pname varchar (a) not null,pnum varchar (a) NOT null) Insert the test data with a comma-delimited insert into test (pname,pnum) VALUES
Tags: First, we create a comma-delimited string. CREATE TABLE Test (id int (6) NOT NULL auto_increment,primary KEY (ID), pname varchar (a) not null,pnum varchar (a) NOT null)
;
Then insert a comma-delimited test data insert into Test (pname,pnum) VALUES (' Product 1 ', '
>=1 andB. NumberLen(A.[Serial Number]) andB.type='P' and substring(','+[Serial Number], Number,1)=','Go Drop TableTBGo /** Number Product quantity Unit price amount serial number-------------------------------------------------001 AA 3 5 001 AA 3 5 001 AA 3 5 1 5 002 BB 8 9 002 bb 8 9 002 bb 8 9*/ ---------- --7. Displaying strings as rows and columnsif object_id('TB') is not NULL Drop TableTBCreate TableTb(Idint Identity(1,1),Snvarchar( -)) Inser
given a string:It is a sequence of several values separated by commas:' 192.168.1.1,192.168.1.2,192.168.1.3 'How do I convert a string to a list?MSTR = ['192.168.1.1'192.168.1.2 ' 192.168.1.3']Use the Str.split method:' 192.168.1.1,192.168.1.2,192.168.1.3 '>>> mstr.split (",") ['192.168.1.1' '192.168.1.2'192.168.1.3']to turn a string into a tuple:>>> mlist = Mstr.split (",")>>> Tuple (mlist) (' 192.168.1.
First we create a comma-delimited string. CREATE TABLE Test (id int (6) NOT NULL auto_increment,primary KEY (ID), pname varchar (a) not null,pnum varchar (a) NOT null) ;Then insert the test data with a comma-delimitedINSERT into Test (pname,pnum) VALUES (' Product 1 ', ' 1,2,4 ');INSERT into Test (pname,pnum) VALUES ('
| Product 5 | 33,4 |+----+-------+---------+3 Rows in Set (0.02 sec)This results in multiple records, such as 33 being found. In a different way
Mysql> SELECT * from test WHERE CONCAT (', ', ' Pnum,', ') REGEXP ' [^0-9]+[3|9][^0-9]+ ';
+----+-------+---------+| ID | PName | Pnum |+----+-------+---------+| 3 | Product 3 | 3,4 || 4 | Product 4 | 1,7,8,9 |+----+-------+---------+2 rows in S
February 6, 2008 by pinaldave
This is very common request recently-how to import CSV file into SQL server? How to load CSV file into SQL Server database table? How to load comma delimited file into SQL server? Let us see the solution in quick steps.
CSV stands for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.