Condense Query Results with Wildcard I have the following query:

select programVersion, count(programVersion) 
     from records R 
     inner join Programs P 
         on P.programID=R.usageProgramID 
     where programName="word" 
     group by programVersion;


Results:

+----------------+-----------------------+
| programVersion | count(programVersion) |
+----------------+-----------------------+
| 12.0.0         |                     1 |
| 12.2.0         |                 32190 |
| 12.2.3         |                    20 |
| 12.2.6         |                  3990 |
| 12.2.8         |                 13128 |
| 12.3.1         |                   114 |
| 12.3.2         |                     4 |
| 12.3.4         |                    20 |
| 14.0.0         |                    57 |
| 14.1.0         |                 86587 |
| 14.1.3         |                    44 |
| 14.1.4         |                   728 |
| 14.2.0         |                    42 |
| 14.2.2         |                   130 |
| 14.2.3         |                 88219 |
| 14.2.5         |                    66 |
| 14.3.0         |                   126 |
| 14.3.1         |                    36 |
| 14.3.2         |                    74 |
+----------------+-----------------------+


For this purpose I don't really care about the minor version increments.  What I'm really interested in is the differences in major increments.  Is there a way that I can get the results combined past the first period?

Example Output 

+----------------+-----------------------+
| programVersion | count(programVersion) |
+----------------+-----------------------+
| 12             |         total of 12's |
| 14             |         total of 14's |
+----------------+-----------------------+
You can use the SUBSTRING_INDEX() function to get the part before the first dot and then group:

select SUBSTRING_INDEX(programVersion, '.', 1) AS programMajorVersion, 
       count(programVersion) AS totalIncrements 
     from records R 
     inner join Programs P 
         on P.programID=R.usageProgramID 
     where programName="word" 
     group by SUBSTRING_INDEX(programVersion, '.', 1) 
     order by CAST(programMajorVersion AS unsigned) ;


The above may not be the most efficient on a large table. If you have indexes that your version uses and is efficient, you may use that as a derived table and then aggregate with the substring function: 

select SUBSTRING_INDEX(programVersion, '.', 1) AS programMajorVersion, 
       SUM(cnt) AS totalIncrements 
     from  
     ( select programVersion, count(programVersion) AS cnt
         from records R 
         inner join Programs P 
             on P.programID=R.usageProgramID 
         where programName="word" 
         group by programVersion
     ) AS t
     group by SUBSTRING_INDEX(programVersion, '.', 1) 
     order by CAST(programMajorVersion AS unsigned) ;