Month names in MySQL column -
I have a MySQL column name known as ... which means The fees were paid for January to March (January was paid for the second instance on February). How do I know about the count of the number of months those fees have been paid? To wit. 1 For example, I would expect to get 3 and 2 for example 2. If the months are always displayed by 3 characters, you may Select We denote the number of months as n , note that the number of commas is less than n Because there is a 'T' at the end of the string, hence the length of this field represents 'Fei' 3 * n + (n-1), which is shown as N , so we 1 N can add and divide by 4. To achieve the nearest integer is the goal round which can be removed in this case. will get the correct answer, length () The length of the string is returning function. fee . The value within
charges is something like:
Jan, Feb, Mar or
Jan, Feb
can use floor ((length (fee) +1) / 4) from table_name;
SELECTA ??? Length (fee) +1) / 4 from table_name;
Comments
Post a Comment