none
SQL querry need help RRS feed

  • Question

  • Hi,

    i am very new in using SQL and i am still learning.

    I need help with a SQL querry.

    Here is my problem.

    Table1

    ResourceID, Computername

    101, Computer1

    201, Computer2

    301, Computer3

    ....

    Table 2

    ResourceID, Software, Version

    101, Java, 8

    101, Adobe

    101, Word

    201, Java, 7

    201, Adobe

    301, Word

    Output should look like that:

    101, Computer1, Java, 8

    201, Computer2, Java, 7

    301, Computer3, Java, not installed

    I am getting:

    101, Computer1, Java, 8

    101, Computer1, Java, not installed

    201, Computer2, Java, 7

    201, Computer2, Java, notinstalled

    301, Computer3, Java, not installed

    Querry I am using:

    SELECT DISTINCT Table1
    
    CASE	WHEN Table2.Software LIKE '%JDK%' THEN Table2.Version	
    		WHEN Table2.Software NOT LIKE '%JDK%' THEN 'JDK_no'
    END AS [Java]
    
    
    
    FROM   v_R_System LEFT JOIN
                             Table2 ON Table1.ResourceID = Table2.ResourceID



    • Edited by Strahle_fz Monday, August 5, 2019 6:07 AM
    Monday, August 5, 2019 5:30 AM

All replies