c# - MySQL Split to use in "SELECT WHERE IN" statement -


I'm putting some MySQL sites in hopes of finding something that will allow me to turn it on:

  var parameter = "a, b, c, d"; // (commas-delimited values ​​can be any number)  

In this (assuming that my parameters are in some way the values ​​you are seeing in these blocks ):

  SELECT * mytable WHERE from parametipe ('A', 'B', 'C', 'D');  

But I have not had much success! The best site I've found:, which discusses the splitting of strings based on a delimiter (',' in my case), although this has not been answered ...

Anyone In a good way of dividing a comma-delimited strings, in the context of the strings that can be used in this context?

This may not have all the flexibility you need, but the MySQL function may be sufficient. For example: To select:

  SELECT * mytable WHERE FIND_IN_SET (from parametertype, 'a,), there is a hard limit of up to 64 values ​​in the set. B, C, D ')! = 0  

This is an example of the use of an in-line MySQL ('a, b, c, d') - it can be an emblem This is a sign that some data models are full of normalization if they are being used.

But to associate with complex information that stays out of the database, they may be easy to join, or to end (in this case).


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -