SQL Abfrage

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • SQL Abfrage

    hi leute,

    habe folgende SQL- Abfrage.

    PHP-Code:
    $Qry "SELECT  Distinct
      MachineGroup.MachineID,
      SInventory.SoftwareID,
      Machine.DomainName,
      Machine.MachineName,
      Machine.MACAddress,
      Machine.OSVerInfo,
      Software.Publisher,
      Software.DisplayName,
      Software.ProductName,
      Software.VersionString,
      Software.SoftwareGroupID,
      Software.ProductType
    FROM
     MachineGroup
     INNER JOIN Machine ON (MachineGroup.MachineID=Machine.MachineID)
     INNER JOIN SInventory ON (MachineGroup.MachineID=SInventory.MachineID)
     INNER JOIN Software ON (Software.SoftwareID=SInventory.SoftwareID)
    WHERE Software.ProductName NOT LIKE '%Hotfix%'
        or  Machine.MachineName LIKE '"
    .$comp."%' 
        or  Software.Publisher LIKE '"
    .$publ."%' 
        or  Software.ProductName LIKE '"
    .$soft."%'
          
    ORDER by  Machine.MachineName"

    es funktioniert alles bis auf:
    PHP-Code:
    Software.ProductName NOT LIKE '%Hotfix%' 
    ich will dass keine datensätze raus kommen deren inhalt mit 'Hotfix' sind.

    kann bitte jemand weiter helfen?
    mfg. f_mal

  • #2
    es gibt auch noch AND-Verknüpfung und Klammer

    WHERE Software.ProductName NOT LIKE '%Hotfix%'
    AND (Machine.MachineName LIKE '".$comp."%'
    or Software.Publisher LIKE '".$publ."%'
    or Software.ProductName LIKE '".$soft."%')

    Kommentar

    Lädt...
    X