There is a syntax you have to follow for sql queries.  when you need data
from two different views, you need to join those views on a common
element.  In this specific case, you will need to join the data from
installed software (contains the add/remove programs displayname) to the
data from system (which contains the computer name) using the
unique-to-ConfigMgr-way to tell a uniqueness of "resourceid".

so..
select distinct sys.name0 [ComputerName from v_r_system]
,arp.ARPDisplayname0 [Add/Remove Programs Name from v_gs_installed_software]
from v_r_system sys
join v_gs_installed_software arp on arp.resourceid=sys.resourceid --Join
the two tables together using the unique attribute
where arp.arpdisplayname0 like  '%my%SQL%' -- you just want the results of
machine that DO have something with a name sorta like that name in the ' ',
because to sql a % is a wildcard



On Tue, Sep 20, 2016 at 8:59 AM, Brian McDonald <mcdonald...@hotmail.com>
wrote:

> I'm getting incorrect Syntax near 'Software'.
>
> Brian
>
> Sent from my iPhone
>
> > On Sep 20, 2016, at 8:37 AM, Marcum, John <jmar...@bradley.com> wrote:
> >
> > Select sys.Name0, v_GS_INSTALLED_SOFTWARE. ARPDisplayName0
> > From v__R_System sys
> > INNER JOIN sys.resourceID on sys.resourceID = v_GS_INSTALLED_SOFTWARE.
> resourceID
> > SOFTWARE where ARPDisplayName0 like '%my%SQL%'
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: listsad...@lists.myitforum.com [mailto:listsadmin@lists.
> myitforum.com] On Behalf Of Brian McDonald
> > Sent: Tuesday, September 20, 2016 8:02 AM
> > To: mssms@lists.myitforum.com
> > Subject: Re: [mssms] RE: MySQL
> >
> > Nice! How do I add to this to get devices with this installed?
> >
> > Brian
> >
> > Sent from my iPhone
> >
> >> On Sep 20, 2016, at 7:34 AM, Marcum, John <jmar...@bradley.com> wrote:
> >>
> >> Looks like it shows in ARP. I see it when I run this:
> >>
> >> select distinct ARPDisplayName0 from v_GS_INSTALLED_SOFTWARE where
> ARPDisplayName0 like '%my%SQL%'
> >>
> >>
> >>
> >>
> >> -----Original Message-----
> >> From: listsad...@lists.myitforum.com [mailto:listsadmin@lists.
> myitforum.com] On Behalf Of Brian McDonald
> >> Sent: Tuesday, September 20, 2016 7:19 AM
> >> To: mssms@lists.myitforum.com
> >> Subject: [mssms] MySQL
> >>
> >> [This message is from outside Bradley. Exercise caution in opening
> attachments or links.]
> >>
> >> Good morning,
> >>
> >> Does anyone have a query to find all devices with MySQL installed?
> >>
> >> Thank you,
> >>
> >> Brian
> >>
> >> Sent from my iPhone
> >>
> >>
> >> ________________________________
> >>
> >> Confidentiality Notice: This e-mail is from a law firm and may be
> protected by the attorney-client or work product privileges. If you have
> received this message in error, please notify the sender by replying to
> this e-mail and then delete it from your computer.
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
>


-- 
Thank you,

Sherry Kissinger

My Parameters:  Standardize. Simplify. Automate
Blogs: http://www.mofmaster.com, http://mnscug.org/blogs/sherry-kissinger,
http://www.smguru.org


Reply via email to