SQL for Missing/Installed/Declined patches

SQL for Missing/Installed/Declined patches

I need to know the SQL statement needed to generate a Missing/Installed/Declined patch status for an individual computer (all computers is fine, I can easily adjust the WHERE clause once I know the proper table joins). I can filter the Vulnerable System Report to show this, but I need to include some calculated fields and there is a good chance I'll be joining this to data stored in ServiceDeskPlus.
                New to ADManager Plus?

                  New to ADSelfService Plus?