Ok me lo sono riletto per bene (credo!!??) e questo pezzo è quello che mi serve giusto??:
FIND_IN_SET(str,strlist)
Returns a value 1 to N if the string str is in the string list strlist consisting of N substrings. A string list is a string composed of substrings separated by `,' characters. If the first argument is a constant string and the second is a column of type SET, the FIND_IN_SET() function is optimized to use bit arithmetic. Returns 0 if str is not in strlist or if strlist is the empty string. Returns NULL if either argument is NULL. This function will not work properly if the first argument contains a comma (`,') character. mysql> SELECT FIND_IN_SET('b','a,b,c,d');
-> 2
e quindi se ho interpretato giusto.....:
1 - anzichè separare le singole parole con il carattere "|", le dovrei separare con la ", (virgola)" giusto??
2 - i risultati che torna sono :
- 0 se la stringa o parola cercata è vuota o se non è presente nel campo indicato per la ricerca;
 - da 1 a N naturalmente se trova la parola. Più precisamente indica il numero corrispondente della parola esaminata nella substring che corrisponde a quella usata per la ricerca!!
 
Solo non ho capito se:
- una volta trovata almeno una corrispondenza perchè soddisfatta la query, si ferma oppure continua a cercare??? Sarebbe utile per vedere quante ce ne sono in ogni substring!!
 - non ho neanche capito se posso cercare più parole insieme ed eventualmente come fare oppure se devo fare tante query quante sono le parole da cercare!!!
 - inoltre se per primo trova subito una virgola la funzione si ferma subito e non continua oppure da proprio un'errore??
 - il campo dove faccio la ricerca deve avere un campo particolare o va bene un LONGTEXT???
 - mi spieghi questo:
 
If the first argument is a constant string and the second is a column of type SET, the FIND_IN_SET() function is optimized to use bit arithmetic.
grazie ancora per il tuo aiuto!!!
:metallica![]()

						
					
					
					
						
  Rispondi quotando