Join Column with different rows, is it possible?

i would like to get a result fields
- Department ID
- total employee
- position under department
Query result A
Department ID | Total employee (under department)
DeptA | 123
Dept B | 222
Dept C | 0
Query result B
Department ID | position
DeptA | programmer
DeptA | lead programmer
DeptB | salesman
Dept C | CEO
Dept C | manager
Dept C | project manager
How can i get a result by joining two tables into one by using a single query?
Department ID | position | Total employee
DeptA | programmer | 123
DeptA | lead programmer | 123
DeptB | salesman | 222
Dept C | CEO | 0
Dept C | manager | 0
Dept C | project manager | 0
Thanks

Hi,
<p>
has it something to do with Need to write a POWERFUL Query. Need Help from MOST Advance Query Master?
</p>

Similar Messages

  • One Key FIgure in more than one column with different restrictions

    Hi,
      I am using a key figure in more than one column with different restrictions, but restriction in one column is affecting the result in other column. What shall i do to make it independent from one another??

    Hi Pravender Chauhan,
        If you want in Single column different value for different Rows based on same Key Figure, you can create Structure where you can define different logic for each row but using same key figure.
    If you want to use different Key figures then you should have to Restricted Key Figure and for any calculation you can use calculated Key figure.
    Assign points if Useful.
    Regards,
    Rajdeep.

  • Creating a list with different row sizes...

    I'm new to AS 3.0 and CS4 and I've been getting up to speed
    on all of it. I've used the List component before with my own
    CellRenderer. I now need to create a list with different row
    heights. The List component is great and does everything that I
    want but it requires all rows to be the same height.
    I'm unsure of where to go. Creating my own class seems like a
    lot of work. The TileList and Grid components don't allow different
    sized (and dynamically changing) row heights either. Is there some
    base class (SelectableList? BaseScrollPane?) that I should extend
    or do I need to just bite the bullet and write it all from scratch?
    I need each row to have it's own height and interaction with
    a row could change the height of the row. The main use is a list of
    data. If the user clicks in an item, it turns the display into
    something they can edit (which will need more height).
    Thanks for any thoughts on a direction I should think about.
    By the way, I really like that AS 3.0 is much more consistent of a
    programming language than previous MX versions that I've used.
    We're doing a lot of AS/Flash/AIR work with it and it's turning
    into a wonderful environment...

    Any ideas about this??

  • How can I setup an .indd with two columns with different threads so that I can export to epub?

    Hi all. Sorry, english is not my native language. I´ve made an .indd: each page has two columns with different threads (is a bilingual text). When I export this .indd to .epub only appears one column from a thread following the next thread. What can i do to fix this? My indesign is CS6
    Thank you

    There are fixed format EPUB files as can be used for children's books, etc. where there are a lot of illustrations. However, those are very work-intensive to produce. I've never worked on one.
    Anne-Marie Concepcion did a Lynda.com video on producing one.
    Rorohiko produces a product called ePubCrawler which can help in produced fixed format EPUB files:
    Fixed Layout EPUB Assistant In InDesign: ePubCrawler | Rorohiko ...

  • MS SQL - Add column with all rows being "0"

    Add column with all rows being "0"

    nevermind
    "lee" <[email protected]> wrote in message
    news:e3b5kt$mch$[email protected]..
    > Add column with all rows being "0"
    >
    >
    >

  • Merging two columns with muliple rows in Numbers '09

    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon

    sanpanza wrote:
    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon
    Hi Ed,
    Use the CONCATENATE() function.
    Street address in column D, Office number in Column E
    100 Smith ST            212
    Formula: =CONCATENATE(E," ",D)
    Result:
    212 100 Smith ST
    Note the formula has three arguments, the reference to column E, a text literal (" ") containing a single space, and a reference to column D.
    Regards,
    Barry

  • Match values of 2 columns with other rows

    I want to compare the values of 2 columns with all rows in the sheet.
    If there is a match I want to place a character in the next column, so I can filter on it
    But I need to keep one row for each unique value. (match of 2 columns)

    Hi,
    I'm marking the reply as answer as there has been no update for a couple of days.
    If you come back to find it doesn't work for you, please reply to us and unmark the answer.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Many to many join table with different column names

    Hi have a joint table with different column names as foreign keys in the joining
    tables...
    e.g. i have a many to many reltnshp btwn Table A and Table B ..and join table
    C
    both have a column called pk.
    and the join table C has columns call fk1 and fk2
    does cmd require the same column name in the join table as in the joining table?
    are there any workarounds?
    thanks

    HI,
    No, the foreign key column names in the join table do not have to match the primary
    key names in the joined tables.
    -thorick

  • ALV Table: DROPDOWN-Column with different valuesets per row

    Hello,
    I tried to create a dropdown by index cell in a table with different valuesets in each row. So I created an attribute VALUESET of type WDR_CONTEXT_ATTR_VALUE_LIST in my node to provide different valuesets per element. In my ALV-table I bound the property "valueset_fieldname" of the dropdown-cell to the context-attribute VALUESET:
      lo_column = lo_alv_model>if_salv_wd_column_settings~get_column( id = 'PRICE').
      CREATE OBJECT lo_drop_down_idx
        EXPORTING
          selected_key_fieldname = u2018PRICEu2019.
      lo_drop_down_idx->set_valueset_fieldname( value = u2018VALUESETu2019 ).
      lo_column->set_cell_editor( lo_drop_down_idx ).
    Now I have the problem, that the list of the dropdown-cell displays the proper amount of values but not the proper texts . My valueset looks for example like this:
    Value: A
    Text:  A
    Value: B
    Text:  B
    Value: C
    Text:  C
    Value: D
    Text:  D
    But my Dropdown-cell shows these values:
    A
    A
    A
    D
    Could you please help?
    Edited by: Developer on Feb 2, 2010 5:32 PM

    Hello Lekha,
    thank you for your answer. I think there might be an other reason for this problem. When I debug the view with the Webdynpro-Debugger the valueset in the context contains the correct values but the dropdown shows wrong values.
    You also sent me a link with a codesample. In this coding you use the following statement:
    lr_drp_idx->set_texts( 'VALUESET'   ). This is a method of the class CL_WD_DROPDOWN_BY_IDX. I used the class cl_salv_wd_uie_dropdown_by_idx as I'm working with an ALV-Table. This class doesn't have the method set_texts. Instead it has a method called 'set_valueset_fieldname'. Maybe this method has a bug?
    Regards,

  • How to update a column with different values but all other row values r sam

    Hi,
    I have a table like this.
    Col1 col2 col3 col4
    10 20 30
    10 20 30
    10 20 30
    i need to update col4 with different values coming from other table like this
    Col1 col2 col3 col4
    10 20 30 xxxx
    10 20 30 yyyy
    10 20 30 zzzz
    how can i update the table. pls let me know how to use the where condition in the update stmt.
    thanks,
    jay
    Edited by: user2558790 on Nov 20, 2009 12:26 PM

    what is the logic for this kind of update...????
    Greetings,
    Sim

  • Join columns of different data types

    Can i join two columns of different data types in a single statement. Is there any cast or convert statement
    SELECT B~PARTNER AS RESP_GROUP
    FROM BUT000 AS B
    INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO.
    Here PARTNER_GUID is Raw 16 and PARTNER_NO is Char 32, the query is not returning any rows.
    Thanks
    Akila.R

    Hi!
    Basically we can say, you can't join them, but you might try this way:
    SELECT B~PARTNER AS RESP_GROUP
    FROM BUT000 AS B
    INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO(16).   "add
    (16)
    Or an other version
    C~PARTNER_NO+16(16)   "depends on, where is the real number stored
    Regards
    Tamá

  • Joining Facts With Different Grains to NonConfirming Dimensions - Mystery

    Hi ,
    Taxonomy Used is - CD stands for Confirmed Dimension && NCD stands for Non Confirmed Dimension.
    I have 3 Dimensions (CD1,NCD2,NCD3) and 2 facts (F1 & F2).
    ==> Fact F1 can be joined to only CD1 and NCD2 dimensions. Grain of Fact F1 is same as CD1 i.e., Nbr of records matches 1 to 1 between CD1 and F1F2
    ==> Fact F2 can be joined to only CD1 and NCD3 dimensions. Grain of Fact F2 is CD1 & NCD3. There could be multiple records for same value of CD1 within Fact F2, and similarly there could be multiple records for same value of NCD3. But there will always be just 1 and only 1 record for combination of CD1 and NCD3.
    Report Requirements:-
    1) Get few Metrics from F2 and few from F1 while applying a filter on NCD2. so below columns are needed :-
    Dimension Column from NCD2 || Metric from Fact1 || Metric from Fact2
    So need to understand how to enforce the relationship between Fact F2 and Dimension NCD2
    2) Get few Metrics from F2 and few from F1 while applying a filter on NCD2 and also Display NCD3. so below columns are needed :-
    Dimension Column from NCD2 || Dimension Column from NCD3 ||Metric from Fact1 || Metric from Fact2
    ==> In above case it is perfectly acceptable if Metric from Fact 1 repeats again as Fact1 is at higher Grain as compare to Fact2.
    Edited by: user10799880 on Apr 15, 2013 9:37 PM

    Hi,
    refer to this
    http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
    mark helps
    thanks

  • 2 SDO_GEOM columns with different coord systems

    Hi
    I have an intersection (traffic lights, etc.) that when shown on the map is a point and its position is stored as Lat/Long. However, when I zoom in on this intersection I need to be able to bring up a schematic (detailed plan) which will be in some cartesian coords.
    My thought is to store the schematic data as a geometry collection in the same table as the rest of the data.
    Is this possible?
    And, are there any traps I should be looking for?

    You are free to mix geometries with different coordinate systems in a table, as long as all the geometries in a given column of the table have the same coordinate system. This should support what you are trying to do with expanded levels of detail in your point features.

  • Best way to give a default value to a New Column with existing rows

    Adding some columns to SQL tables with existing data rows. There are also views created from these tables. The views are used in some report/query software so NULL values are not good. Interested in learning about the best way to set a default value. 
    These are the ways that I can think of
    1) ALTER TABLE using the DEFAULT to add the column and set the default value
    ++ Adds a constraint which is not terrible. Constraints are just not used much in this shop.
    2) ALTER TABLE to add the column then do an UPDATE statement to update the values
    ++ might be an issue for tables with millions of rows
    3) ALTER TABLE to add the column then use ISNULL in the CREATE VIEW

    It is a large table with 444 columns and max row size of 2268. 907k records took 1 minute 38 seconds to UPDATE the column. I have about 12 fields to add to this table and about 44 tables (not all this large of course) so it will take some time to
    UPDATE.  Although ... i just tried updating 3 columns in a single UPDATE and it took 1 minute 36 seconds. So If I did all 12 fields in a single UPDATE it would be about the same time as a single Field.  I will think about it.

  • Joining Facts with Different Grains

    Hello
    We have a requirement where we have two facts with different grains
    DEPT_FACT - Contains (Dept_Id, Dept_Name, Revenue)
    EMP_FACT - Contains (Emp_Id, Dept_Name, Is_Current_Employee)
    Here is some sample data
    DEPT_FACT
    ========
    1 Sales_Dept 100,000
    2 Manufacturing_Dept 200,000
    EMP_FACT
    ========
    100 Sales_Dept Y
    200 Sales_Dept Y
    300 Sales_Dept N
    400 Manufacturing_Dept N
    500 Manufacturing_Dept Y
    600 Manufacturing_Dept N
    Our requirement is to create an OBIEE report that shows the *"Revenue/ Number of current employees in department BY Department"*
    The above example must show
    Sales_Dept => $50,000 (100,000 / 2 current employees)
    Sales_Dept => $200,000 (200,000 / 1 current employee)
    Any suggestions on how this can be done ?

    For me,
    DEPT_FACT is not a fact. It's a dimension table because you have a one-to-many relationship and you have a measure in the dimension table (it's an aggregated measure).
    And EMP_FACT is also not a fact because you don't have any measure on it.
    But if we say that EMP_FACT is a fact. DEPT_FACT is an aggregated table from EMP_FACT.
    I will :
    * create a logical dimension for the employee with three levels (all, departement and detail)
    * create a logical fact table with :
    - one logical column for the revenue in the level all departement
    - one logical column for the employee
    and two physical source :
    * DEPT_FACT with the departement level
    * EMP_FACT with the level to detail
    Success
    Nico

Maybe you are looking for

  • IPhone 3gs restores to iOS 4.0 but won't restore to iOS 5 'Unknown Error 1'

    I have an iPhone 3gs 32gb that accidentally went through the washing machine a couple of years ago. It was dead and rested peacefully in its box under the bed until a few months ago when I found it and thought - let's try turning it on. Low and behol

  • AP - WLC joining issue

    We have 3 WLC's(5500) in our network and about 150 AP's. Only 4 AP's register to 1 controller, over 70 to 2nd and about 50 to 3rd. On checking & comparing few of the AP's this is what i concluded. 1. 4 AP's that registered to the first WLC did not ha

  • Is there a way to add a font button to the toolbar in RH 10

    Is there a way to add a font button to the toolbar in RH 10

  • FCP X not recognising Anamorphic clips

    I have several thousand clips captured as PAL SD anamorphic They were captured from Digibeta using the AJA Kona Preset Prores 720x576 Anamorphic. When imported into FC X, there seems to be no way of telling it how to display those clips correctly. I

  • Error message F:\setup.EXE on Equium

    I have just started having problems with Equium laptop, trying to install some software all i now get is F:\setup.EXE The directory name is invalid. Could really do with some assistance if possible. thanks