/build/static/layout/Breadcrumb_cap_w.png

Having SQL trouble efficiently connecting asset table fields.

I have created the following custom assets. . .
FS54tQ.png8eos0a.pngoh3pBT.png
The data I need is in AD_11.FIELD_10068. What is needed depends on the selection of AD_16.FIELD_10044.
AD_16.FIELD_10044 is presented to the user, via a single select custom field in a ticket .
Depending on the selection, I look to AD_16 fields - FIELD_10062, 63, 64, 65, 66. To get the correct result from AD_11.FIELD_10068 I join the matching text in AD_16 fields to AD_11.FIELD_31. A simple query, for one of the AD_16 fields runs very quickly. For example -

SELECT
    ASSET_DATA_16.FIELD_10042 AS Program_number,
    ASSET_DATA_16.FIELD_10043 AS Status,
    ASSET_DATA_16.FIELD_10053 AS Media_Center,
    RPM.FIELD_10068 AS Reg_Prgm_Mgr
FROM ASSET_DATA_16
LEFT JOIN ASSET_DATA_11 RPM ON RPM.FIELD_31 = ASSET_DATA_16.FIELD_10062
GROUP BY Program_number

returns what I am after very quickly.

I can add one more of the AD_16 fields and corresponding join to this query and it runs satisfactorily but, trying to query for any more fields or all five fields at the same time runs on and on. There are instances where only 2 or 3 of the AD_16 fields have data but, I need to query all 5 fields every time.

Any help would be most appreciated. I have other questions around these asset tables but this one is urgent and I need to get it resolved ASAP.

0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: jmarotto 6 years ago
Fourth Degree Green Belt
0

Top Answer

See - http://www.itninja.com/question/trouble-connecting-the-sql-dots

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ