Help needed for SCCM SQL query

Hello.
I have the below query to extract the workstations build date as well as the hardware info. This works fine. 
Select distinct
v_R_System.Name0,
v_GS_COMPUTER_SYSTEM.Manufacturer0,
v_GS_COMPUTER_SYSTEM.Model0,
v_GS_COMPUTER_SYSTEM_PRODUCT.Version0,
v_GS_OPERATING_SYSTEM.Caption0,
v_GS_OPERATING_SYSTEM.CSDVersion0,
v_GS_OPERATING_SYSTEM.InstallDate0
From v_R_System
LEFT JOIN v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.ResourceID=v_R_System.ResourceID
LEFT JOIN v_GS_COMPUTER_SYSTEM_PRODUCT ON v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID=v_R_System.ResourceID
LEFT JOIN v_GS_COMPUTER_SYSTEM ON v_GS_COMPUTER_SYSTEM.ResourceID=v_R_System.ResourceID
LEFT JOIN v_GS_SYSTEM_CONSOLE_USAGE ON v_R_System.ResourceID=v_GS_SYSTEM_CONSOLE_USAGE.ResourceID
Where v_GS_OPERATING_SYSTEM.Caption0 = 'Microsoft Windows 7 Enterprise' and v_R_System.Is_Virtual_Machine0 =0
order by v_GS_OPERATING_SYSTEM.InstallDate0 desc
Now, I want a report of count of machines built based on "v_GS_COMPUTER_SYSTEM_PRODUCT.Version0" against every month and year of "v_GS_OPERATING_SYSTEM.InstallDate0".
For example, I want to know the number of machines under a particular model (which appears under  v_GS_COMPUTER_SYSTEM_PRODUCT.Version0) built in June 2014. In this fashion I want a report for every model count for every month and year available under
InstallDate0 column)
Example:
Jan 2013 ->  ThinkCentre M92p -> 55
Jan 2013 ->  ThinkCentre M93 -> 40
Feb 2013 ->  ThinkCentre M92p -> 10
Feb 2013 ->  ThinkCentre M93 -> 39
Jan 2014 ->  ThinkCentre M92p -> 20
Jan 2014 ->  ThinkCentre M93 -> 25
Feb 2014 ->  ThinkCentre M92p -> 12
Feb 2014 ->  ThinkCentre M93 -> 35
Can anyone help?

After scratching my head a bit, I came up with the below. Do you find any flaw in it?
Select
v_GS_COMPUTER_SYSTEM.Manufacturer0 as Manufacturer,
v_GS_COMPUTER_SYSTEM.Model0 as Model,
v_GS_COMPUTER_SYSTEM_PRODUCT.Version0 as "Model Info",
COUNT(*) as "No. of machines built",
CASE WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '1' THEN 'January'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '2' THEN 'February'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '3' THEN 'March'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '4' THEN 'April'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '5' THEN 'May'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '6' THEN 'June'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '7' THEN 'July'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '8' THEN 'August'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '9' THEN 'September'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '10' THEN 'October'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '11' THEN 'November'
WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '12' THEN 'December'END as "Month",
YEAR(v_GS_OPERATING_SYSTEM.InstallDate0) as "Year"
From v_GS_COMPUTER_SYSTEM
LEFT JOIN v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
LEFT JOIN v_GS_COMPUTER_SYSTEM_PRODUCT ON v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
Where v_GS_OPERATING_SYSTEM.Caption0 = 'Microsoft Windows 7 Enterprise' Group By v_GS_COMPUTER_SYSTEM.Manufacturer0,
v_GS_COMPUTER_SYSTEM.Model0,
v_GS_COMPUTER_SYSTEM_PRODUCT.Version0,
Month(v_GS_OPERATING_SYSTEM.InstallDate0),
YEAR(v_GS_OPERATING_SYSTEM.InstallDate0)
Order by v_GS_COMPUTER_SYSTEM_PRODUCT.Version0 desc

Similar Messages

  • Help needed in framing SQL query.

    Hi,
    I have table having following schema:
    PRODUCT_ID         INT
    DATE                   DATETIME
    ITEMS_SOLD         INT
    This table contains data for a week (sunday to saturday). I want to write an SQL query to get (filter out) PRODUCT_ID of products which has same no. of ITEMS_SOLD for all 7 days. Also for given PRODUCT_ID I need to find the longest period of successive days where the no. of ITEMS_SOLD is same for all days in this period. Eg.(PRODUCT_ID 23 was sold as following along the week in no. of units sold: 4,6,6,6,6,7,4 .So the longest period is *4 days* from Monday to Thursday.) The first condition is special case of second condition where no. of days is 7.
    Any help to get the SQL query will be appreciated.
    Thanks,
    Akshay.

    PRODUCT_ID      DATE           ITEMS_SOLD
    1          10/10/2011     3
    1          11/10/2011     3
    1          12/10/2011     3
    1          13/10/2011     3
    1           16/10/2011     5
    2          10/10/2011     4
    2           11/10/2011     4
    2          12/10/2011     4
    2          13/10/2011     4
    2           14/10/2011     4
    2          15/10/2011     4
    2          16/10/2011     4
    Output:
    PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
    1          3                4     
    2          4               7
    Explanation of results:
    The table to be queried contains data for 1 week: from 10/10/2011(Sunday) to 16/10/2011(Saturday). Now, product with PRODUCT_ID '1' was sold on dates 10,11,12,13,16. Out of these 5 days 3 units were sold on 4 successive days (from 10-13). So output should be like :
    PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
    1          3               4     
    as longest period of successive days is 4 where same no. of units were sold i.e 3 units (other period is of 1 day on 16th ).
    For PRODUCT_ID 2 we have only one period of 7 days where 4 units were sold each day. So we output :
    PRODUCT_ID ITEMS_SOLD NO_OF_DAYS
    2           4               7
    Other case where same PRODUCT_ID have different units sold on each day should be ignored.
    I hope that clarifies the problem more. Let me know in case I have missed out anything which should have been mentioned.
    -Akshay.

  • Need a SCCM SQL Query Report for Installed Software with Packages and Applications.

    I need a report that will show the number of installs of all of the workstations applications and packages over a given period of time. 
    This will let us know how effective our deployments are and how well the on-demand software is being adopted.
    Any help?

    Your Install Source might be an option as most SCCM deployments will install from C:\Windows\ccmcache\xx [where xx is a random folder name]. Most software vendors will put an install source in the registry, but not all do, so it won't be completely accurate.
    When software is installed manually, the install source path won't be C:\Windows\ccmcache\xx.
    Here is a SQL query I have for Install Source:
    SELECT v_GS_COMPUTER_SYSTEM.Name0 as 'Computer Name', v_GS_INSTALLED_SOFTWARE.ProductName0 as 'Software Title', v_GS_INSTALLED_SOFTWARE.InstallSource0 as 'Install Source', v_GS_INSTALLED_SOFTWARE.ProductVersion0 as 'Version', v_GS_INSTALLED_SOFTWARE.InstalledLocation0
    as 'Installed Location', v_GS_INSTALLED_SOFTWARE.InstallDate0 as 'Install Date'
    FROM v_GS_COMPUTER_SYSTEM INNER JOIN v_GS_INSTALLED_SOFTWARE ON v_GS_COMPUTER_SYSTEM.ResourceID = v_GS_INSTALLED_SOFTWARE.ResourceID
    WHERE v_GS_INSTALLED_SOFTWARE.ProductName0 like '%Office 365 Pro%'
    ORDER BY v_GS_COMPUTER_SYSTEM.Name0

  • Help needed in executing SQL query...

    Hi,
    I am very new to JDeveloper. Curently i am tryin to execute an SQL query from the BPEL process, the output of the query is to be mapped to a variable field from a target xsd file. the query is fairly simple, like
    SELECT emp
    FROM emp_table
    WHERE emp_id=123
    The target field, namely "employee", is an element from the xsd file. I tried using Java embedding activity to connect to the db and execute the query through a piece of Java code, but couldn't find a way to assign the output of the query to the field. however lately i also discovered the Database Adapter services which helps me create a database connection, but still i am not sure as of how to handle and map the output of the query to the variable field.
    Can somebody please help me in resolving the issue either through Java Embed activity or Database Adapter services??
    Thanks in advance
    Anjan

    Anjan,
    I suggest you try the [url http://forums.oracle.com/forums/forum.jspa?forumID=212]BPEL Forum
    John

  • Help need for Outer Join Query Mysterious Query...

    I have two table parent tablea and child tableb
    Now
    tableb has field by name table_id,keyword_name,keyword_value
    tablea has field by name
    table_id,table_name
    I need a query which would retrieve union of this two set...(for table_name)
    1)all table_name having keyword_name='abc' and value=12
    2)all the table_name that does not have 'abc' as keyword in tableb.....
    Please let me know how it can be done....

    Ok then, try this.
    select
        a.table_name
    from
        tablea a, tableb b
    where
        a.table_id = b.table_id
        and b.keyword_name = 'abc'
        and b.value = 12
    union
    select
        c.table_name
    from
        tablea c
    where
        not exists (select 1 from tableb d
                    where d.table_id = c.table_id
                          and d.keyword_name = 'abc'
                   ) ;To get a faster answer and avoid wrong guesses, I always find it helpful to show sample data and sample output when asking a SQL question. For example:
    TableA -----------------
    table_id    table_name
      1           AAA
      2           BBB
      3           CCC
      4           DDD
      5           EEE
    TableB -----------------
    table_id    keyword_name   value
        1             abc       12
        1             def       23
        2             abc       13
        4             def       12
        5             abc       13
        5             def       12
    Desired output of query: -----------------
    AAA
    CCC
    DDD

  • Help need  for  PL/SQL  collections

    Hi All,
    Please help me to solve the following Error.
    Error # ORA-06533: Subscript beyond count.
    I am using Oracle 10g.
    I have data in the Test_table
    id_col stat_col reason_col
    101 A          HPQ
    101 A NULL
    101 NULL EDU
    101 P NULL
    102 P NULL
    102 NULL HEN
    103 R NULL
    103 Q NULL
    Ny requirement is like:
    id_col stat_col_ reason_col
    101 A|P HPQ|EDU
    102 P HEN
    103 R|Q NULL
    step1- Type tab_type as table of varchar2(32767);
    step2 - I have written a function which returns the pl/sql table type
    create or replace function fn_get_val(id in VARCHAR2)
    return tab_type
    cursor my_cur is
    select id_col,stat_col,reason_col
    from test_table WHERE ID_COL = ID;
    lv_status VARCHAR2(100);
    LV_reason varchar2(200);
    lv_sep CHAR(1);
    lv_disp_stat varchar2(200);
    lv_disp_reason varchar2(200);
    LN_STR NUMBER;
    BEGIN
    lv_tab_data:= tab_type();
    lv_tab_data.extend;
    open my_cur;
    loop
    fetch my_cur into lv_status,lv_reason;
    exit when my_cur%notfound;
    --dbms_output.put_line('my_curr.rowcount'|| my_curr.rowcount);
    lv_disp_stat:= lv_disp_stat||lv_sep||lv_status;
    lv_disp_reason:= lv_disp_reason||lv_sep||lv_reason;
    lv_sep:= '|';
    end loop;
    -- To remove first occurance of (|) pipeline in the string.
    LN_STR := INSTR(lv_str1,'|',1,1);
    IF LN_STR = 1 THEN
    lv_disp_stat := SUBSTR(lv_disp_stat ,2 );
    END IF;
    LN_STR := INSTR(lv_str2,'|',1,1);
    IF LN_STR = 1 THEN
    lv_disp_reason := SUBSTR(lv_disp_reason ,2 );
    END IF;
    lv_tab_data(1) := lv_disp_stat;
    lv_tab_data.extend;
    lv_tab_data(2) := lv_disp_reason;
    return lv_tab_data;
    EXCEPTION
    DBMS_OUTPUT.PUT_LINE('Error in function fn_get_val # '||SQLERRM||' - '||dbms_utility.format_error_backtrace);
    END fn_get_val;
    STEP-3
    I have created one procedure where the above function is called
    CREATE OR REPLACE PROCEDURE my_proc (p_emp_id in Varchar2)
    AS
    lv_tab_ty tab_type;
    CURSOR DET_CUR IS
    SELECT EMP_ID_C,NAME_C,LOCATION
    FROM DETAILS_TABLE
    WHERE EMP_ID_C = p_emp_id;
    type det_tab_ty is table of det_cur%type index by pls_integer;
    lv_det_rec det_tab_ty;
    BEGIN
         lv_tab_ty := fn_get_val(p_emp_id);
         dbms_output.put_line('lv_tab_ty.count is : '||lv_tab_ty.count);
         OPEN DET_CUR;
         LOOP
         FETCH DET_CUR BULK COLLECT INTO lv_det_rec;
         EXIT WHEN DET_CUR%NOTFOUND;
         END LOOP;
         CLOSE DET_CUR;
         IF lv_det_rec.COUNT > 0 THEN
         FOR i IN lv_det_rec.FIRST .. lv_det_rec.LAST
         LOOP
         INSERT INTO other_tab (emp_id_c,name_c,Loc_c,status_c,reason_c) values(lv_det_rec(i).emp_id_c,lv_det_rec(i).NAME_C,lv_det_rec(i).LOCATION,lv_tab_ty(1),lv_tab_ty(2) );
         END LOOP;
         END IF;
    COMMIT;
    EXCEPTIONS
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Error in procedure my_proc # '||SQLERRM||' - '||dbms_utility.format_error_backtrace);
    END my_proc ;
    After exucting the above procedure i am getting the following error.
    lv_tab_ty.count is : 1
    Error # ORA-06533: Subscript beyond count.
    This error is occured when my_curr.rowcount is equal to 0 (cursor defined in the function fn_get_val() ).
    The function fn_get_val() does return null to the pl/sql table variable (lv_tab_ty).
    AND another schenario:
    If
    lv_tab_data.count = 1
    Then how can i handle this situation in the above procedure,because i need both
    lv_tab_data(1)
    and lv_tab_data(2)
    to insert to the OTHER_TABLE in the procedure.
    Please help me to solve this issue.
    Thanks in Advance!!!
    PKM

    You can do it with one query with Tom Kyte's stragg function:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3431223221768118::::P11_QUESTION_ID:15637744429336
    with test_table(id_col,stat_col,reason_col) as (
    select 101,'A','PQ' from dual union all
    select 101,'A',NULL from dual union all
    select 101,NULL,'EDU' from dual union all
    select 101,'P',NULL from dual union all
    select 102,'P',NULL from dual union all
    select 102,NULL,'HEN' from dual union all
    select 103,'R',NULL from dual union all
    select 103,'Q',NULL from dual
    select id_col,replace(stragg(stat_col),',','|'),replace(stragg(reason_col),',','|')
    from test_table tt
    group by id_colRegards,
    Sayan M.

  • Help needed for writing a Query.

    I want to write a query in SSRS, SQL Server 2012, Report Builder 3.0. There is 3 tables as follows
    Table A
    ID Name
    1 AAAAA
    2 BBBBB
    Table B
    ID BS
    1 5000
    2 3000
    Table C
    ID Allowance
    Amt
    1 HRA
    500
    1 TA
    200
    2 HRA
    300
    Output Expected
    ID Name
    BS HRA
    TA
    1 AAAAA
    5000 500
    200
    2 BBBBB
    3000 300
    0
    Shareef

    This is the result from the above code: 
    id          Name       BS          Allowance   TA
    1           AAAAA      5000        500         200
    2           BBBBB      3000        300         0
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
     [Blog]
    But I am getting something like this.
    id          
    Name       BS         Allowance TA
    1          
    AAAAA      5000        500         
    1          
    AAAAA 
    200
    2           BBBBB
         3000        300         0
    Shareef

  • Help need for PL/SQL procedure

    Hi guys,
    I have scenario like this
    Schema     T     LOGTABLENAME          TDIRECTORY
    DEV          DEV.ABC_LOG                    import-abc
    DEV          DEV.GBTSLOG          import-gbts
    DEV          DEV.CLSSBOG     import-cls
    QA          QA.TransactionlOG          import-transaction
    QA1 QA1.tlog import-ess
    QA2 QA2.translog import-trnals
    I have to write a procedure to get the log table data from schema Dev.I have to take Shcema dev and go to DEv.abc_log table and get the record from the dev.abc_logtable. The same way for other schema also with respective logtables .
    I would appreciate your help or suggestions.
    Reards,
    User
    Edited by: user1758353 on Dec 5, 2008 11:43 AM

    hello,
    im also not sure if i get the point but maybe you need sth. like that...
    create table schema_logtable as
    select 'dev' schema, 'dev.abc_log' tlogtable, 'import-abc' tdirectory from dual union all
    select 'dev', 'dev.gbtslog', 'import-gpts' from dual union all
    select 'dev', 'dev.clssbog', 'import-cls' from dual );
    declare
       v_slt_row schema_logtable%rowtype;
       type log_description_table is table of varchar2(1000char);
       v_log_description log_description_table := log_description_table();
    begin
       for v_slt_row in ( select * from schema_logtable )
       loop
          execute immediate 'select log_description from ' || v_slt_row.tlogtable bulk collect into v_log_description;
          for i in v_log_description.first .. v_log_description.last
          loop
             dbms_output.put_Line( 'log_desc: ' || v_log_description(i) );
          end loop;
       end loop;
    end;
    /this reads for every schema in table schema_logtable the name of the logtable.
    for each logtable you fetch all rows of that table into a variable and you can do what-ever you want with that...
    -mario

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Need Oracle Payroll SQL Query

    Hello,
    I need Oracle Payroll SQL Query with result:
    First_name, Last_name, Payment_amount, Pay_date, Payroll_Frequency, Employement_status
    Any Help would be greatful appreciated

    You will need the following tales.
    per_all_people_f, per_all_assignments_f,pay_run_results,pay_run_result_values
    Query would e something like :
    select papf.first_name,
             papf.last_name,
             prrv.*
    From  apps.per_all_people_f papf
             apps.per_all_assignments_f paaf
             apps.pay_run_results prr,
             apps.pay_run_result_values prrv
    Where papf.person_id = paaf.person_id
    and papf.business_group_id = paaf.business_group_id
    and papf.current_employee_flag = 'Y'
    and paaf.primary_flag ='Y'
    and paaf.assignment_type = 'E'
    and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
    and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date 
    and prr.assignment_id = paaf.assignment_id

  • Dashboard Prompt - Getting error for Adding SQL query in "Default to"

    Hello Oracle,
    I am facing some problem in Dashboard Prompt. Like when i add some sql query in "Default to" in Dashboard prompt and for the next prompt when i check for Contrain option i get error in the second prompt. but it works fine when i hard-code a value in "Default to" options.
    For Example:
    Like when we consider a two prompts :
    1) Year -> (In Default to i select SQL Query and enter the query as SELECT "YTD Dim"."Fiscal Year" FROM "YTD Report" WHERE "YTD Dim"."Fiscal Year" = Year(Current_Date)
    2) Business Unit -> (In specific value i give as some hard code value of Business Unit and check the contrain option)
    i get error as
    Business Unit
    Error Generating Drop Down Values
    A numeric value was expected (received "SELECT "YTD Dim"."Fiscal Year" FROM "YTD Report" WHERE "YTD Dim"."Fiscal Year" = Year(Current_Date)"). Error Details
    Error Codes: EHWH2A7E
    but i get correct value for Year as 2011.
    I need to use SQL query in default to option and need to check the constrain option too.
    Looking for positive feedback.

    You need to create a dashboard prompt and in Default To -> select SQL Results
    Click on the ... (three dots ) underneath it and put in your sql
    For Example , I have a Table called "Sales Date" in my "ABC" presentation folder. This has a column called "Year" and "Date". If I want to have a Year prompt with the default value set to current year, here is what the syntax of my sql result will be :-
    SELECT "ABC"."Sales Date".YEAR
    FROM "ABC"
    WHERE "Date" = current_date
    In SQL, we cannot put SQL as we know of in terms of Oracle, Sql Server etc. The SQL here refers to sql as OBIEE understands it and should be in the form of Select "Presentation foler"."Table Name".ColumnName from "Presentation Folder"
    Hope this helps

  • Help me write a SQL query; urgent

    Hi, can somebody please help me write a SQL query.
    I have 3 tables each with the same column names (Col1, Col2, Col3). Col1 is PK with Unique Constraint.
    I wanted to add values of Col2 and Col3 (from all 3 tables) and put it in a separate table (i.e aggregated) of all values found in Col1.
    Does anybody help me please ?
    thanks alot.

    Please don't mark your question as urgent. You've been around here long enough that you should know that it will not get your question anwered any faster, and may just irritate people into not answering at all.
    I'm not sure exactly what you want.
    Are you saying you want t1.c2 + t1.c3 + t2.c2 + t2.c3+ t3.c2 + t3.c3 for the rows that have the same c1 in all three tables?
    If so, it would be like this, I think: insert into t4
    select t1.c1
    , t1.c2 + t1.c3 + t2.c2 + t2.c3+ t3.c2 + t3.c3
    from t1, t2, t3
    where t2.c1 = t1.c1
    and t3.c1 = t1.c1If that's not what you want, please clarify.
    And next time maybe you should post your SQL question in a SQL forum.

  • Help needed to optimize the query

    Help needed to optimize the query:
    The requirement is to select the record with max eff_date from HIST_TBL and that max eff_date should be > = '01-Jan-2007'.
    This is having high cost and taking around 15mins to execute.
    Can anyone help to fine-tune this??
       SELECT c.H_SEC,
                    c.S_PAID,
                    c.H_PAID,
                    table_c.EFF_DATE
       FROM    MTCH_TBL c
                    LEFT OUTER JOIN
                       (SELECT b.SEC_ALIAS,
                               b.EFF_DATE,
                               b.INSTANCE
                          FROM HIST_TBL b
                         WHERE b.EFF_DATE =
                                  (SELECT MAX (b2.EFF_DATE)
                                     FROM HIST_TBL b2
                                    WHERE b.SEC_ALIAS = b2.SEC_ALIAS
                                          AND b.INSTANCE =
                                                 b2.INSTANCE
                                          AND b2.EFF_DATE >= '01-Jan-2007')
                               OR b.EFF_DATE IS NULL) table_c
                    ON  table_c.SEC_ALIAS=c.H_SEC
                       AND table_c.INSTANCE = 100;

    To start with, I would avoid scanning HIST_TBL twice.
    Try this
    select c.h_sec
         , c.s_paid
         , c.h_paid
         , table_c.eff_date
      from mtch_tbl c
      left
      join (
              select sec_alias
                   , eff_date
                   , instance
                from (
                        select sec_alias
                             , eff_date
                             , instance
                             , max(eff_date) over(partition by sec_alias, instance) max_eff_date
                          from hist_tbl b
                         where eff_date >= to_date('01-jan-2007', 'dd-mon-yyyy')
                            or eff_date is null
               where eff_date = max_eff_date
                  or eff_date is null
           ) table_c
        on table_c.sec_alias = c.h_sec
       and table_c.instance  = 100;

  • Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with re

    Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with reddish cast and loss of detail
    System: Windows 7
    Adobe CS5
    Printer: Epson Stylus Photo 1400
    Paper: Inkjet matte presentation paper with slight luster
    Installed latest patch for Adobe CS5
    Epson driver up to date
    After reading solutions online and trying them for my settings for 2 days I am still unable to print what I am seeing on my screen in Adobe CS5. I calibrated my monitor, but am not sure once calibration is saved if I somehow use this setting in Photoshop’s color management.
    The files I am printing are photographs of dogs with lots of detail  I digitally painted with my Wacom tablet in Photoshop CS5 and then printed with Epson Stylus 1400 on inkjet paper 20lb with slight luster.
    My Printed images lose a lot of the detail & come out way to dark with a reddish cast and loss of detail when I used these settings in the printing window:
    Color Handling: Photoshop manages color, Color management -ICM, OFF no color adjustment.
    When I change to these settings in printer window: Color Handling:  Printer manages color.  Color management- Color Controls, 1.8 Gamma and choose Epson Standard it prints lighter, but with reddish cast and very little detail and this is the best setting I have used so far.
    Based on what I have read on line, I think the issue is mainly to do with what controls are set in the Photoshop Color Settings window and the Epson Printer preferences. I have screen images attached of these windows and would appreciate knowing what you recommend I enter for each choice.
    Also I am confused as to what ICM color management system to use with this printer and CS5:
    What is the best ICM to use with PS CS5 & the Epson 1400 printer? Should I use the same ICM for both?
    Do I embed the ICM I choose into the new files I create? 
    Do I view all files in the CS5 workspace in this default ICM?
    Do I set my monitor setting to the same ICM?
    If new file opens in CS5 workspace and it has a different embedded profile than my workspace, do I convert it?
    Do I set my printer, Monitor and PS CS5 color settings to the same ICM?
    Is using the same ICM for all devices what is called a consistent workflow?
    I appreciate any and all advice that can be sent my way on this complicated issue. Thank you in advance for your time and kind help.

    It may be possible to figure out by watching a Dr.Brown video on the subject of color printing. Adobe tv
    I hope this may help...............

  • File missing (file\BCD error code 0Xc0000034 help need for work!

    file missing (file\BCD  error code 0Xc0000034 help need for work!    what can i do?
    have an p 2000 notebook pc

     Hi bobkunkle, welcome to the HP Forums. I understand you cannot boot passed the error you are receiving.
    What is the model or product number of your notebook? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

Maybe you are looking for

  • Boot from Disk without an optical drive

    One of my clients brought me a 12" PowerBook G4 with booting issues. Through much troubleshooting I've determined that it needs an Archive & Install. The problem is that optical drive is not functioning. (The client reports that the laptop was droppe

  • Loop through contents of textarea / arrays in PL/SQL?

    Hi all, I have the need to allow a user to update a large number of rows at once. His data source is a spreadsheet. Basically, he receives a file weekly that contains dozens of vehicle numbers and dates that they are to be delivered. My thinking is t

  • Problem in setting loginHeader

    Hi all, I am developing a web service. In my "TouricoRequestSoapBindingImpl.java" file I have set username & password in the SOAP header using loginHeader object. Earlier it was working perfectly fine but suddenly it has stopped working and the code

  • IPhone syncing with new located Songs

    Well all my songs are in a new location, and the songs on my iphone the songs where synced off the old location so will they be replaced if I sync now?

  • Setting RBO in oracle 10g

    Hello All, my PROD is currently running in 9i hp ux. we are planning for upgrade to 10.2.0.4. most of my application uses RBO in my 9i database. when it migrates to 10g Developers and customer dont want to use default CBO as they will have to make lo