1
I have an appointment that returns some class names/disciplines, but I wanted you to bring me only the names of disciplines. Below follows the query result with the default [class][discipline][subsidiary]:
ADM N1A OFFICIAL COMMUNICATION (MES)
ADM N1A PHILOSOPHY LOGIC AND ETHICS (MES)
ADM D1A OFFICIAL COMMUNICATION (AB)
ADM D1A PHILOSOPHY LOGIC AND ETHICS (AB)
ADM N1A PHILOSOPHY LOGIC AND ETHICS (AB)
PGER N1A SOCIAL AND LABOUR LEGISLATION (MES)
CCONT N1A ACCOUNTING THEORY (MES)
FIN N1A OFFICIAL COMMUNICATION (MES)
I noticed the following pattern: the name of the discipline starts just after the 2nd space and ends just before the last space (before the space preceding the "opens parentheses").
To the string: [FIN N1A OFFICIAL COMMUNICATION (MES)]
I wish to return only: [OFFICIAL COMMUNICATION]
I don’t know much about mysql, so I’ll get any help from my heart.
P.S. I NEED TO PASS THIS FILTER DIRECTLY IN THE QUERY (QUERY MYSQL)
Sorry for not specifying in the question, but it is necessary to pass this filter directly in the query (query mysql). I’ll change the description of the question right now.
– GOliveira
No, there isn’t. I didn’t tag jquery on that question, I put query. But thank you, @dvd
– GOliveira
I had already tested Aki several shapes and had managed now just with the query below: select substr(stroke, length(SUBSTRING_INDEX(stroke, ' ',2))+2, INSTR(stroke,' (')-length(SUBSTRING_INDEX(stroke, ' ',2))-2) from table; But thanks, @dvd. Your query ran exactly as I needed.
– GOliveira