Retrieving Data

  • Hi, I have data in two tables software and computer, I need to be able to select the computer name from one table and software from the other by title, I can select one product using the following: -

    Select t0.[Name] AS 'Computer Name', t1.[ProductName] AS 'Software', t0.[guid] FROM [computer]

    to INNER JOIN [software] t1 on t0.[guid] = t1.[guid]

    WHERE t1.[ProductName] = 'MS PROJECT'

    This returns OK, I now need to return only computers that have MS PROJECT and MS WORD or that Have MS PROJECT but NOT MS WORD

    Can anybody help?

  • hi,

    may be you could try using the 'in' operator in where conditon for multiple inputs.

    Sorry, this is what you expected.

    Select t0.[Name] AS 'Computer Name', t1.[ProductName] AS 'Software', t0.[guid] FROM [computer]

    to INNER JOIN [software] t1 on t0.[guid] = t1.[guid]

    WHERE t1.[ProductName] in ( 'MS PROJECT','MS WORD')

  • hi,

    may be you could try use the 'in' operator in where condition for multiple inputs.

    Sorry, if this is what you not expected.

    Select t0.[Name] AS 'Computer Name', t1.[ProductName] AS 'Software', t0.[guid] FROM [computer]

    to INNER JOIN [software] t1 on t0.[guid] = t1.[guid]

    WHERE t1.[ProductName] in ( 'MS PROJECT','MS WORD')

  • Wont that just provide an OR clause? I need to know where both exist or where one exists and not the other

    Thanks

  • Yes , OR operator's functionality is, it will returns the computers, which is having both or either one of the software is present.

    excel word computers

    1 1 1

    0 1 1

    1 0 1

    0 0 0

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply