Join this two table HELP

Hi to all.. i have this two table , the problem is i dunno how to join this two table into one, becoz in the forms i have two button "BUTTON A IS FOR TABLE A WHICH IS THE EMPLOYEE.. AND BUTTON B IS FOR ADMIN... WHAT I WANT IS TO MAKE THIS TWO BUTTON INTO ONE BUTTON.. i;m using form6i and run in client server..
Guys any one here know plz help how to do this..
TABLE 1
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
          go_item('PASSNAME1');
          :passname1:=null;
          end if;
end;
TABLE 2
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Admin1
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
          go_item('PASSNAME1');
          :passname1:=null;
          end if;
end;

like i told you before in this posting How to join this two tables
use a union
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname
union
select username,passname
into :pass.username,:pass.passname1
from Admin1
where :pass.username=username
and :pass.passname1=passname;

Similar Messages

  • How to join this two tables

    Hi
    have a two login in forms not in oracle... i have two tables first the
    Master secodn the Employees.. my prob is i have two button for this two tables to login.. any solution on how i can join this two in one button that if i connect using from master tables or from employess it will login
    FirstTAble:::
    BEGIN
    iF :username IS NULL THEN
    MESSAGE ('Please enter Username ');
    MESSAGE ('Please enter Username ');
    GO_ITEM('username');
    RAISE FORM_TRIGGER_FAILURE;
    end if;
    IF :PASSNAME1 IS NULL THEN
    MESSAGE('Please enter password.');
    MESSAGE('Please enter password.');
    GO_ITEM('PASSNAME1');
    RAISE FORM_TRIGGER_FAILURE;
    end if;
    select username,passname
    into :pass.username,:pass.passname1
    from Master
    where :pass.username=username
    and :pass.passname1=passname;
    Message('Access Granted');
    Message('Access Granted');
    go_block('maina');
    hide_view('pass1');
    exception
    when no_Data_found then
    set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
    if show_alert('wrong')=alert_button1 then
              go_item('PASSNAME1');
              :passname1:=null;
              end if;
    end;
    SEcodnTAble
    BEGIN
    iF :username IS NULL THEN
    MESSAGE ('Please enter Username ');
    MESSAGE ('Please enter Username ');
    GO_ITEM('username');
    RAISE FORM_TRIGGER_FAILURE;
    end if;
    IF :PASSNAME1 IS NULL THEN
    MESSAGE('Please enter password.');
    MESSAGE('Please enter password.');
    GO_ITEM('PASSNAME1');
    RAISE FORM_TRIGGER_FAILURE;
    end if;
    select username,passname
    into :pass.username,:pass.passname1
    from Employees
    where :pass.username=username
    and :pass.passname1=passname;
    Message('Access Granted');
    Message('Access Granted');
    go_block('maina');
    hide_view('pass1');
    exception
    when no_Data_found then
    set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
    if show_alert('wrong')=alert_button1 then
              go_item('PASSNAME1');
              :passname1:=null;
              end if;
    end;

    use a union on the 2 select statements.

  • Doubt on creating join between  two tables

    Hi friends,
    I have two tables , ekes and eine
    my requirement is  if Ekes-ebtyp = 'X1'.
    then Ekes-ebtyp = EKES-EINDT + Eine-j_3alitra.
    the doubt is there is no primary key common between this table . actually in my whole program for purchase order i used EBELN for extracting details when two tables are involved . in this two tables no two primary keys are common to extract data ...is there any ways please suggest..
    the code i wrote is
    loop at li_ekes assigning <fl_ekes>.
    read table li_eine assigning <fl_eine> with table key (here i need to give some unique fields to join these two fields please guide me which field i can use.).
    <fl_ekes>-ebtyp = <fl_ekes>-EINDT + <fl_eine>-j_3alitra.

    Hi,
    Both tables have field EBELN in common.
    You can use it to extract data from both.
    Hope this helps.
    reward if helpful.
    Regards,
    Sipra

  • Prcedure to joining of two tables and pls explore the primary & foriegn key

    Dear All,
    Am new to this forum looking forward to have some discussions and guidance reg ABAP.
    <b>My query is</b>
    what is the prcedure to joining of two tables and pls explore the primary & foriegn key relationships.
    Your kind help is required in this query .
    Thanks n regards
    Carol P

    Hi Carol,
    Joining two tables fetch data from tables that has relevent entry based on the keys. like LIKP and LIPS these are delivery tables. if the business requirement is fetching delivery data that are exists in both two tables. here LIKP will conatins a single entry against a condition and LIPS may contains several entry because one delivery may has multiple line items. so, fetch the data joining the two tables on vbeln that is delivrey number. this is used to increase the performance of the program except for all entries.
    Foreign key is poiting twowards primary key; it may be 1:1 , 1:many and many:many. if field1 of table a is pointing towards field1 of table b. then based on these condition at the time of entry SAP will check how many entry can be entred in field1 of table a.
    regards
    Krishnendu

  • Subject: How to do join between two tables using something like SE16

    SE16, SE11 provide form based interface query information from a single table. Is there a way to do join between two tables without creating an infoset erc? I am looking for something similar to sql join but in SAP BI 7.0
    Thanks.

    Hi
    Pls look into below links. Hope this helps you.
    1. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45bf455611d189710000e8322d00/content.htm
    2. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45a5455611d189710000e8322d00/content.htm
    Regards
    Sirigiri

  • Join on two tables using "LIKE"

    Hi all,
    I need make join on two tables (QMEL and STXL) using keys for connection:
    - field for join of first table is (QMEL-QMNUM - Notif. number - Char 12)
    - field for join of second table is  (STXL-TDNAME - Char 70)
    If it is connection based on EQ, I think, it's no problem but I need to connect it on base of 'LIKE'.
    Example:
    QMEL-QMNUM = '100100698075'
    I would like get all rows from STXL which contain or even better start with notif. number.
    Examples I would like connect with QMEL-QMNUM:
    STXL-TDNAME = '100100698075'
    STXL-TDNAME = '1001006980750001'
    STXL-TDNAME = '10010069807500010001'
    STXL-TDNAME = '10010069807500010002'
    etc..
    Am I able to manage that with select which join these two tables this way?
    Thanks for any solution
    Vaclav Hosek.

    Hi,
    Write 2 separate selects for this.
    select * from QMEL
    where......
    if sy-subrc = 0.
    loop at i_qmel into wa.
    r_tdname-option = 'CP'.
    r_tdname-sign = 'I'
    concatenate wa-qnum '*' into r_tdname-low.
    append r_tdname.
    endloop.
    select *
    from STL
    where tdname in r_tdname.
    endif.

  • Sql join on two tables where column like another column

    hi all,
    been trying to get the results from a join between two tables where one column is like another one.
    table1 (nameA) examples: black2, green1
    table2 (nameB) example: black2.location.uk.com, green1.location.uk.com
    so for example I want to match all those in table1 with black2 to the column in table2 that begins with black2 and so on if you see what im trying to get at!
    my sql so far:
    select * from  schema.table1 a
    join schema.table2 b
    on a.nameA like concat('%', b.nameB, '%'); but it errors:
    ORA-00909: invalid number of arguments
    00909. 00000 - "invalid number of arguments"
    Any help or advice would be greatly appreciated, thankyou!

    Either of these should do it...
    select * from  schema.table1 a
    join schema.table2 b on a.nameA like '%'||b.nameB||'%';or
    select * from  schema.table1 a
    join schema.table2 b on instr(b.nameB,a.nameA) > 0

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All,
    Is there anyway to implement the custom sql query in CR for joining the two tables?
    My requirement here is I need to write sql logics for joining the two tables...
    Thanks,
    Gana

    In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
    Log on to your data source if necessary.
    Under your data source, double-click the Add Command node.
    In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
    For example:
    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
    Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
    Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
    For more information about creating parameters, see To create a parameter for a command object.
    Click OK.
    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
    Note:
    To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
    By default, your command is called Command. You can change its alias by selecting it and pressing F2.

  • Help in join of two tables

    Hi,
    I have following 2 tables
    CREATE TABLE a
    sr_no INT
    CREATE TABLE b
    sr_no INT,
    startdate DATE,
    remark VARCHAR2(30)
    One to many mapping relationship exists between the two tables.
    for each sr_no in table a ther exists multiple/no record in table b.
    If there are multiple entries in table b for a single entry in table a,
    then i want remark data which is corresponding to minimum of the startdate in table b
    Example data of table b
    1     10/15/2009     one
    1     10/29/2009     one1
    2     10/28/2009     two
    3     10/27/2009     three
    4     10/26/2009     four
    minimum date of the first 2 records is 10/15/2009.so i want remark as "one" when i join the 2 tables.
    How do we achieve that ?

    Something like this?
    SELECT  SUB.SR_NO
    ,       SUB.STARTDATE
    ,       B.REMARK
    FROM
            SELECT  SR_NO
            ,       MIN(STARTDATE) AS STARTDATE
            FROM   B
            GROUP BY SR_NO
    )       SUB
    JOIN    B       ON B.SR_NO = SUB.SR_NO AND B.STARTDATE = SUB.STARTDATEThat is one possibility. There are many, many ways to achieve this kind of result.

  • Regarding joining of two tables with same feilds

    hello gurus
    i am new to abap programming. i have to extract data from two tables ie coss and cosp tables . one table has 180 records and another table has 500 records i want to extract these two table records into internal table(680 records) and then i have to populate it to flatfile through gui download. can any one give me use code to work on it.these two tables has same set of feilds.

    Hi,
    First you should verify if you want to get all the data from both tables regardless if its the same record. If it is, then you can follow this logic:
    select * from coss into table it_coss_cosp. "step 1
    select * from cosp appending table it_coss_cosp. "step 2
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        filename                      = data.txt
      FILETYPE                      = 'ASC'
      APPEND                        = ' '
      WRITE_FIELD_SEPARATOR         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = it_coss_cosp
    EXCEPTIONS
      FILE_WRITE_ERROR              = 1
      NO_BATCH                      = 2
      GUI_REFUSE_FILETRANSFER       = 3
      INVALID_TYPE                  = 4
      NO_AUTHORITY                  = 5
      UNKNOWN_ERROR                 = 6
      HEADER_NOT_ALLOWED            = 7
      SEPARATOR_NOT_ALLOWED         = 8
      FILESIZE_NOT_ALLOWED          = 9
      HEADER_TOO_LONG               = 10
      DP_ERROR_CREATE               = 11
      DP_ERROR_SEND                 = 12
      DP_ERROR_WRITE                = 13
      UNKNOWN_DP_ERROR              = 14
      ACCESS_DENIED                 = 15
      DP_OUT_OF_MEMORY              = 16
      DISK_FULL                     = 17
      DP_TIMEOUT                    = 18
      FILE_NOT_FOUND                = 19
      DATAPROVIDER_EXCEPTION        = 20
      CONTROL_FLUSH_ERROR           = 21
      OTHERS                        = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    But if you plan to get those record which exists in both tables then use a join condition for your select statement.
    Hope this helps...
    P.S. Please award points for useful answers.

  • Join between two tables in SAP ( actual sales vs budget sales)

    I have one table with  actual data sales in SAP .This table has a name   CE11000
    This table contain amounts about : customers ,Products, Quantity of Sales ,amount of sales ,month witch did the sales and the year.
    The other table from SAP has the budget sales . This table is CE21000
    This table contain the same fields : customers ,Products, Quantity of Sales ,amount of sales ,month witch did the sales and the year but all this for budget .
    In the budget table ( CE21000)there are no records for a particular make if it was not budgeted to make a sale.
    Sometimes i have the same problem with the actual data table (CE11000) ...I have not records witch can use to join the results for a report witch take the comparison between actual sales and budget sales.
    I would like to remind you that the report should have four "dimensions"
    a) year
    b) month
    c) customer
    d) type of product
    I try to use left outer join with a customer fields in two tables but i have  simultaneously the field with type of product .
    I want to see in one year (for example february of 2011)  for one customer the type of products (quantity and anmounts) witch buy (ACTUAL)  and that to  compare with the corresponding data if available
    Any help would appreciate
    thanks

    Haggar
    Your first query matches on two conditions BOTH being true. If there is a D and no matching E, you'll see the columns from D but none from E.
    Your second query takes all Emplyees, and lines up 2 (possibly different) rows from D against each
    E columns | D columns (match e.deptid=d.dept_id) | D columns (match ep_id=de_id)
    So you may have any mix of:
    E       | D1      | D2
    E       | nothing | D2
    nothing | D1      | D2
    E       | D1      | nothing
    E       | nothing | nothing
    nothing | D1      | nothing
    nothing | nothing | D2(NB I'm assuming FULL OUTER JOIN is commutative - ie the order is unimportant - but I may be wrong in which case the last row won't occur)
    You will get a different number of rows (as well as different columns) in each case.
    Try it!
    Regards Nigel

  • Multiple foreign key joins between two tables

    Hi,
    I have a question about building a repository.
    I have a date dimension and one fact. The fact table has about 10 foreign key columns that link to the date Dimension.
    In this case should I create 10 aliases to create joins in the Physical and BMM layer or is there any other way to handle this situation.
    I am asking this question because 10 aliases can get very confusing for me at the later point of time while creating reports.
    Using OBIEE 10.1.3

    Hi
    I have a follow up question on this.
    I am okay with not seeing the different date tables under the Subject area. Even if it just shows a it as a Simple DATE Dimension I am good with it.
    In this case which is the efficient way, creating 10 aliases or creating 10 joins in the physical layer. I just figured out that we can create multiple joins between the same set of two tables but do not know how will that effect the way BI server works.
    Please help me in understanding this concept.
    thanks
    This request id for OBIEE 10.1.3

  • SQL Join between two tables two columns, but the data in the join condition could be null.

    hello all,
    can anyone help me write an outer join b/n the two tables below. The joining condition has if's and or's.
    table 1 has 2 million rows, table 2 is very small
    TABLE1
    CUSTOMER_ID
    CITY
    STATE
    1
    SKOKIE
    IL
    2
    CHICAGO
    IL
    3
    CARY
    NC
    ERIE
    PA
    PHILLY
    PA
    CHARLOTE
    NC
    2 MILLION
    CITYXY
    STATEX
    TABLE2
    CITY
    STATE
    CONTACT
    IL
    OJO
    ERIE
    BRITT
    PA
    MIKE
    PITTSBURG
    PA
    HILTON
    N043
    TAT
    affi
    B
    affi
    R
    b0b
    Q
    b0b
    CHARLOTE
    NC
    b0b
    problem :: for all the data in table1, I need to find out the CONTACT from table 2 And the join condition would be as below
    1. either both TABLE1.CITY=TABLE2.CITY AND TABLE1.STATE=TABLE2.STATE and get CONTACT
    OR
    2. TABLE1.CITY=TABLE2.CITY AND TABLE2.STATE IS NULL  and get the value of CONTACT
    OR
    3. TABLE1.STATE=TABLE2.STATE AND TABLE2.CITY is null and get the value of CONTACT
    I need a query like this
    SELECT A.CUSTOMER_ID, A.CITY, A.STATE, B.CONTACT
    FROM TABLE1 A, TABLE2 B
    WHERE (join condition fitting in the 3 condition mentioned above)

    Dear OP,
    Do you want something like this?
    > with t1 as
    -- Start of SAMPLE DATA
    (select 1 CUSTOMER_ID, 'SKOKIE' CITY, 'IL' STATE from dual union
    select 2, 'CHICAGO', 'IL'  from dual union
    select 3, 'CARY', 'NC' from dual union
    select 4, 'ERIE', 'PA'  from dual union
    select 5, 'PHILLY', 'PA'  from dual union
    select 6, 'CHARLOTE', 'NC' from dual)
    t2 as
    (select null CITY, 'IL' STATE, 'OJO' CONTACT from dual union
    select  'ERIE', null, 'BRITT'  from dual union
    select null, 'PA', 'MIKE'  from dual union
    select 'PITTSBURG', 'PA', 'HILTON'  from dual union
    select 'N043', 'TAT', 'affi'  from dual union
    select null,'B', 'affi'  from dual union
    select null,'R', 'b0b'  from dual union
    select null,'Q', 'b0b'  from dual union
    select 'CHARLOTE', 'NC', 'b0b'  from dual
    --- END IF SAMPLE Data
    select * from t1 full outer join t2
    on ( nvl(t1.city,t2.city) = nvl(t2.city,t1.city)
    and nvl(t1.state,t2.state) = nvl(t2.state,t1.state) )
    order by 1,2,3,4
    CUSTOMER_ID CITY     STATE CITY      STATE CONTACT
              1 SKOKIE   IL              IL    OJO    
              2 CHICAGO  IL              IL    OJO    
              3 CARY     NC                           
              4 ERIE     PA    ERIE            BRITT  
              4 ERIE     PA              PA    MIKE   
              5 PHILLY   PA              PA    MIKE   
              6 CHARLOTE NC    CHARLOTE  NC    b0b    
                               N043      TAT   affi   
                               PITTSBURG PA    HILTON 
                                         B     affi   
                                         Q     b0b    
                                         R     b0b    
    12 rows selected
    Elapsed: 00:00:00.112
    Hope this is helpful. If not please let us know what is you desired result (sample) if your data was like above?
    vr,
    Sudhakar

  • How to build a query to join on two tables without mapping

    I did Automatic mapping by the workbench Directofield mapping with the table and java object.
    Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
    Please help.............
    Spent one full day for this................

    Thanks Don for the reply,sorry to bug you,but i need help.....
    SELECT A.AGNCY_C,
         A.TYPE_C,
         A.RESN_C,
         A.S_TYPE_C,
         A.SUB_ID_C,
         A.RY_C
    FROM RATING A, REF B
    WHERE A.ID_C = B._ID_C
    AND A.ALPHA_C = B.ALPHA_C
    AND A.EFF_D >= B.MATURITY_D
    This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
    Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
    So how to build a query by using toplink.
    tried your example
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression creditRating = builder.getTable("RATING").getField("ID_C");
    Expression issue_ref = builder.getTable("REF").getField("ID_C");
    Expression join = creditRating.equal(issue_ref);
    I am getting java.lang.OutOfMemoryError
    error.
    I selected the option generate classes and descriptors
    from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
    In Database script for the table RATING like this
    ALTER TABLE RATING ADD (
    CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
    REFERENCES REF (ID_C,ALPHA_C));
    I think when i generate descriptor automatically it is keeping this association.
    Please help me.........

  • How can i join this two query?

    I have two table table employee and CSEReduxResponses
    In table employee i have
    CREATE TABLE [dbo].[employee](
    [emp_id] [int] IDENTITY(1,1) NOT NULL,
    [emp_namefirst] [varchar](255) NOT NULL,
    [emp_namemiddle] [varchar](50) NULL,
    [emp_namelast] [varchar](255) NOT NULL
    on responds i have 
    CREATE TABLE [dbo].[CSEReduxResponses](
    [response_id] [int] IDENTITY(1,1) NOT NULL,
    [employee] [int] NOT NULL,
    [employeedept] [int] NOT NULL,
    [star] [tinyint] NOT NULL,
    [status] [int] NOT NULL,
    [approvedby] [int] NULL,
    [approveddate] [datetime] NULL,
    [execoffice_status] [int] NULL,
    Im trying to get the employee with the MAX execpffice_status( this is either a 1 or 0).
    i have this query that i made for it
    select top(1) with ties employee, SUM(execoffice_status) as 'total'
    from   CSEReduxResponses
    group by employee
    order by 'total' desc
    my query for employee table is 
       select emp_namefirst as first , emp_namelast as [last]
    from phonelist.dbo.employee where emp_namefirst is not null
    How can i get this 2 query together so i can output the employee (first and last )name
    with the max exeoffice_status?
    i use :
    Microsoft SQL Server Management Studio 10.0.2531.0
    ps: sorry if i put this is the wrong forum, this is my first time here and first post.

    Are you looking for the below?
    CREATE TABLE [dbo].[employee](
    [emp_id] [int] IDENTITY(1,1) NOT NULL,
    [emp_namefirst] [varchar](255) NOT NULL,
    [emp_namemiddle] [varchar](50) NULL,
    [emp_namelast] [varchar](255) NOT NULL
    Insert into Employee Values('abc','bcd','cdf')
    Insert into Employee Values('xyz','yxw','xwv')
    CREATE TABLE [dbo].[CSEReduxResponses](
    [response_id] [int] IDENTITY(1,1) NOT NULL,
    [employee] [int] NOT NULL,
    [employeedept] [int] NOT NULL,
    [star] [tinyint] NOT NULL,
    [status] [int] NOT NULL,
    [approvedby] [int] NULL,
    [approveddate] [datetime] NULL,
    [execoffice_status] [int] NULL,
    Insert into [CSEReduxResponses]( employee,employeedept,star,status,approvedby,approveddate,execoffice_status)
    Values(1,100,1,1,1,GETDATE(),0),
    (1,100,1,1,1,GETDATE(),1),
    (2,100,1,1,1,GETDATE(),0)
    ;With cte as( Select *,SUM([execoffice_status]) over(partition by Employee) sumstatus From [CSEReduxResponses] )
    Select Distinct A.*,B.sumstatus
    From Employee A
    Inner Join cte B On A.emp_id = B.employee
    --OR
    ;With cte as( Select employee ,SUM([execoffice_status]) sumstatus From [CSEReduxResponses] group by Employee)
    Select Distinct A.*,(Select sumstatus From cte B where A.emp_id = B.employee)
    From Employee A
    Drop table Employee,[CSEReduxResponses]

Maybe you are looking for

  • Update External data Column in share point2010 list

    Hi all, i have list and i am using External data column (From BCS). I am trying to update the external data field value. its updating and showing in view correctly but when i try to edit its showing old value only. Ex: I have a external data with fie

  • Sun.awt.X11.XToolkit processException

    In my application, I'm embedding a Java AWT Frame into a Qt widget and for that I'm using "sun.awt.X11.XEmbeddedFrame.java" class. I pass the "Window Id" of the QWidget to XEmbeddedFrame which then displays itself into the QWidget. The embedding work

  • Is there a limit to media import in premiere?

    This question come in connection with media pending which is another (unsolved) problem that I have with Premiere for 2 weetks now and nobody seems to know a solution. I have the trouble with media pending for 2 weeks now. All the files are fine (in

  • Catastrophic failure

    hi , i am facing a catatrophic failure with '8000fff' error code . i have connected db with the oracle driver from asp page. do u have any idea ab this matter????

  • Find out FormServer version in pl/sql procedure

    Can anybody tell mee... How can I get the version number of the FormServer through which my pl/sql procedure has been called? Thanks, Attila