Group by with null field

Hi,
I am trying to write a group by query that is basically:
Select a,
b (sometimes null),
c,
sum(d),
sum(e)
from (union select a,b,c....),
G,
H
where G.field = a and
H.field = b (+)
group by a,
b,
c
Since b is sometimes null, depending if I use an inner or outer join, I will either only get the records where b is not null, or only get the records where b is null.
I obviously would like all the records whether or not b is null.
I tried using the nvl function but then how can I use the join to H?
Can anyone help me here?
Thanks.
Leah

Hi,
I just learned something new. I did not know that there was such a thing as a full outer join. Thank you for that alone.
I just solved the problem. I once again used the nvl function and joined to the other folder in the administrator using outer join on master along with one to one between master and detail, and detail item might not exist in master folder. It actually worked.
Thank you for your help and to anyone else who looked at my question.
Leah

Similar Messages

  • Using Group BY with text fields

    Hi,
    Is there any way around the problem of not being able to
    GROUP BY a text field???
    I have tried using the CAST (name AS VARCHAR(8000)) but it
    doesn't return the full value of the field...... I am getting about
    250 characters returned....
    Is there any way around this? ,

    I am assuming MS SQL Server. According to SQL Server Books
    Online:
    Note: Columns of type text, ntext, and image cannot be used in
    group_by_expression.
    For GROUP BY clauses that do not contain CUBE or ROLLUP, the
    number of group_by_expression items is limited by the GROUP BY
    column sizes, the aggregated columns, and the aggregate values
    involved in the query. This limit originates from the limit of
    8,060 bytes on the intermediate work table that is needed to
    hold intermediate query results. A maximum of 10 grouping
    expressions is permitted when CUBE or ROLLUP is specified.
    Phil

  • Union two tables with diffrent count of fields with null and float value

    Hello,
    i want to union two tables, first one with 3 fields and second one with 4 fields (diffrent count of fields).
    I can add null value at end of first select but it does not work with float values in second table. Value form second table is convert to integer.
    For example:
    select null v1 from sessions
    union
    select 0.05 v1 from sessions
    result is set of null and 0 value.
    As workaround i can type:
    select null+0.0 v1 from sessions
    union
    select 0.05 v1 from sessions
    or simple change select's order.
    Is any better/proper way to do this? Can I somehow set float field type in first select?
    Best regards,
    Lukasz.
    WIN XP, MAXDB 7.6.03

    Hi Lukasz,
    in a UNION statement the first statement defines the structure (number, names and types of fields) of the resultset.
    Therefore you have to define a FLOAT field in the first SELECT statement in order to avoid conversion to VARCHAR.
    Be aware that NULL and 0.0 are not the same thus NULL+0.0 does not equal NULL.
    In fact NULL cannot equal to any number or character value at all.
    BTW: you may want to use UNION ALL to avoid the search and removal of duplicates - looks like your datasets won't contain duplicates anyhow...
    Regards,
    Lars

  • Need help with NULL values in Crosstables

    Hello everybody,
    I need some help with NULL values and crosstables. My issue is the following:
    I have a query (BW - MDX-Query) that gives me turnover measures for each month. In Crystal Reports I choose crosstable to display this whereby I put all month in columns and all turnover-measures in rows. Each month that has a value (measures are not empty) is chown in the crosstables rows. So far so good. The problem occures when there are month that actually have no values (measures are empty). In that case these months are not chown in columns. But I need CR to display these columns and show the value 0. How can I do that?

    Hi Frank,
    Cross tab shows the data based on your column and these column fields are grouped and based on the group it will show your summaries. 
    If there is no data for any of your group it will not display that group.  In this case you will have to create a standard report which should look like cross tab and to get zero values you need to write formulas .
    Example if you want to display Moth wise sales :
    if Month() = 01 Then
    sum() else 0
    Now this formula will check if your month is Jan, then it will sum up the values else it will display zero value. 
    This is possible only through standard report not with Cross Tab.
    Thanks,
    Sastry

  • Understanding logminer results -- inserting row into table with CLOB field

    In using log miner I have noticed that inserts into rows that contain a CLOB (I assume this applies to other LOB type fields as well, have only tested with CLOB so far) field are actually recorded as two DML entries.
    --the first entry is the insert operation that inserts all values with an EMPTY_CLOB() for the CLOB field
    --the second entry is the update that sets the actual CLOB value (+this is true even if the value of the CLOB field is not being set explicitly+)
    This separation makes sense as there may be separate locations that the values are being stored etc.
    However, what I am tripping over is the fact the first entry, the Insert, has a RowId value of 'AAAAAAAAAAAAAAAAAA' which is invalid if I attempt to use it in a flashback query such as:
    SELECT * FROM PERSON AS OF SCN #####'  where RowId = 'AAAAAAAAAAAAAAAAAA'The second operation, the Update of the CLOB field, has the valid RowId.
    Now, again, this makes sense if the insert of the new row is not really considered "+done+" until the two steps are done. However, is there some way to group these operations together when analyzing the log contents to know that these two operations are a "+matched set+"?
    Not a total deal breaker, but would be nice to know what is happening under the hood here so I don't act on any false assumptions.
    Thanks for any input.
    To replicate:
    Create a table with CLOB field:
    CREATE TABLE DEVUSER.TESTTABLE
            ID NUMBER
           , FULLNAME VARCHAR2(50)
          , AGE NUMBER  
          , DESCRIPTION CLOB
           );Capture the before SCN:
    SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Insert a new row in the test table:
    INSERT INTO TESTTABLE(ID,FULLNAME,AGE) VALUES(1,'Robert BUILDER',35);
         COMMIT;Capture the after SCN:
    SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Start logminer session with the bracketing scn values and options etc:
    EXECUTE DBMS_LOGMNR.START_LOGMNR(STARTSCN=>2619174, ENDSCN=>2619191, -
               OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.CONTINUOUS_MINE + -
               DBMS_LOGMNR.COMMITTED_DATA_ONLY + DBMS_LOGMNR.NO_ROWID_IN_STMT + DBMS_LOGMNR.NO_SQL_DELIMITER)Query the logs for the changes in that range:
    SELECT
           commit_scn, xid,operation,table_name,row_id
           ,sql_redo,sql_undo, rs_id,ssn
           FROM V$LOGMNR_CONTENTS
        ORDER BY xid asc,sequence# ascResults:
    2619178     0C00070028000000     START                  AAAAAAAAAAAAAAAAAA     set transaction read write
    2619178     0C00070028000000     INSERT     TESTTABLE     AAAAAAAAAAAAAAAAAA     insert into "DEVUSER"."TESTTABLE" ...
    2619178     0C00070028000000     UPDATE     TESTTABLE     AAAFEXAABAAALEJAAB     update "DEVUSER"."TESTTABLE" set "DESCRIPTION" = NULL ...
    2619178     0C00070028000000     COMMIT                  AAAAAAAAAAAAAAAAAA     commitEdited by: 958701 on Sep 12, 2012 9:05 AM
    Edited by: 958701 on Sep 12, 2012 9:07 AM

    Scott,
    Thanks for the reply.
    I am inserting into the table over a database link.
    I am using the new version of HTML Db (2.0)
    HTML Db is connected to an Oracle 10 database I think, however the table I am trying to insert data into (via the database link) is in an Oracle 8 database - this is why we created a link to it as we couldn't have the HTML Db interacting with the Oracle 8 database directly due to compatibility problems (or so I've been told)
    Simon

  • AVERAGE on crosstable with NULLs

    Hi,
    I try to set average function on column in crosstable. Data contains NULLs. I got error during displaing report in HTML format (in Interactive format it's ok) - "oracle.xdo.XDOException: java.lang.reflect.InvocationTargetException".
    Oracle support says Publisher is not working with NULLs in crosstable - but in Interactive View it's ok (almost - I see NaN instead of empty/NULL value).
    This simple query and some data:
    SELECT
    'Group' || ROUND((LEVEL+1)/4) "GROUP",
    'Row' || LEVEL "ROW",
    TRUNC(CURRENT_DATE) "DATE",
    LEVEL VALUE1,
    CASE WHEN mod(LEVEL,2) = 0 THEN LEVEL+LEVEL ELSE CAST(NULL AS NUMBER) END VALUE2
    FROM DUAL CONNECT BY LEVEL <= 9;
    GROUP | ROW | DATE | VALUE1 | VALUE2
    Group1 | Row1 | 2011-08-02 | 1 |
    Group1 | Row2 | 2011-08-02 | 2 | 4
    Group1 | Row3 | 2011-08-02 | 3 |
    Group1 | Row4 | 2011-08-02 | 4 | 8
    In pure SQL i get correct result:
    SELECT "GROUP",
    AVG(VALUE1),
    AVG(VALUE2)
    FROM (
              SELECT 'Group' || ROUND((LEVEL+1)/4) "GROUP",
                   'Row' || LEVEL "ROW",
                   TRUNC(CURRENT_DATE) "DATE",
                   LEVEL VALUE1,
                   CASE WHEN mod(LEVEL,2) = 0 THEN LEVEL+LEVEL ELSE CAST(NULL AS NUMBER) END VALUE2
              FROM DUAL CONNECT BY LEVEL <= 9
    GROUP BY "GROUP"
    Edited by: stashek on 2011-08-08 23:37

    A step is a dimension, which represents date.
    User is prompted to choose possible period from such:
    25 months with step of 6 months
    13 months with step of 1 month
    1 day with step of 1 hour
    I have a special view in DB, which calculates each step, e.g. for period "1 month with step 1 day":
    Name              StartDate           EndDate                 Step                    Number
    1 month         2014-06-11         2014-07-11          2014-06-12            IM1000000
    1 month         2014-06-11         2014-07-11          2014-06-13            IM1000001
    1 month         2014-06-11         2014-07-11          2014-06-13            IM1000002
    So what I am doing, is calculating Count of Number ForEach step.
    Then I add field Resolution Code from another table, and thus I get my chart.
    Basically, what I need to have as trend line is Average Count for Each Step despite Resolution Code.
    Hope, this makes my issue clearer.
    P.S. =Average(Count(Number) foreach([Step])) in Report isn't helping, the issue is the same.

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • Crosstab report with null or wrong totals

    I have a crosstab report that when I put a field in an item report area and setting <all> for values I get null values and with other fields I get wrong results (less than I wait). If there's no report item, it's return the correct results.
    I have checked the SQL and it not return any null value.
    I believe that the crosstab try to aggragate and sum the null values of the empty cells in my crosstab.
    Anyone knows how to fix it?
    I'm using Discoverer 10g Desktop.

    can you send your xml data and template to [email protected]

  • Import data with nulls in Desktop Intelligence

    Hello,
    I have data with null values (in a measure).  If I export the data as CSV it shows null values as #EMPTY.  If I use that as a datasource, it loads #EMPTY as 0 (zero).
    Is there a way to make desktop intelligence recognize null values?  I tried to remove the #empty and just leave the column empty, it still loads as a numeric zero.
    Same (actually worse) for XML.  It seems if I export my data to XML it can not use that as a datasource.  Odd.  So I created the following XML file:
    <?xml version='1.0' encoding='UTF-8'?>
    <data>
      <item key="AAAAAEUK" value="130" category="A" />
      <item key="AAAACGDC" value="66" category="A" />
      <item key="AAAADNJP" value="56" category="A" />
      <item key="AAAAFWRQ" value="222" category="A" />
      <item key="AAAAGITU" category="B" />
    </data>
    I would expect the value field to be null for the last row.  But the values turns out to be 222!  If I try to put anything else, an empty string "", "#EMPTY", "null", it is always returned as 0.
    This is a problem because 0 an null are differnt when computing averages.

    Hi Florian,
    What is the source of your csv data?
    If I have a table in excel with empty cells, the data goes into the .csv as nothing so your example would look like
    Item key,value,category
    AAAAAEUK,130,A
    AAAACGDC,66,A
    AAAADNJP,56,A
    AAAAFWRQ,222,A
    AAAAGITU,,B
    This reads in just fine in DeskI (shows #EMPTY in the view data, treats it as such in the report).
    So I would look to get the data generated in right way, then DeskI can handle it, no problem.
    If all else fails, just run a search&replace and change ,#EMPTY, to ,,
    BTW if you have an alphanumeric value in a column where DeskI already decided there should be numeric,
    it will read in as 0, that is why the #EMPTY string value got transformed to zero.
    Good luck,
    Marianne

  • Creating table with null and not null values.

    I have to create a table with 5 Null nd 5 Not Null fields.My questionis which fields are place first?Not or Not Null and why???

    What you mean is: the person who asked you the question thought the order of columns was important, and wanted to see if you agreed. Or maybe they were just asking the question to see whether you thought it was important (as a test of your understanding of the database).
    When I started out in Oracle I was told that it was good practice to have the mandatory columns first and then the optional columns. But if you do some research you find this: the impact of column ordering on space management is: empty nullable columns at the end of the table take up zero bytes whereas empty nullable columns at the middle of the table take up one byte each. I think if that saving really is important to you you need to spring for an additional hard drive.
    Besides, even if you do organise your columns as you suggest, what happens when you add an eleventh NOT NULL column to your table? It gets tacked on to the end of your table. Your whole neat organisation is blown.
    What does still matter is the positioning of large VARCHAR2 columns: they should be the last columns on your table in case they create chaining. Then any query that doesn't need the large columns can be satisfied without reading the chained block, something that can't be guaranteed if you've got columns after a VARCHAR2(4000) column. This doesn't apply to CLOBs, etc. which are stored separately anyway.
    Cheers, APC

  • How do you get a line with MULTIPLE fields to WRAP ?

    How do you get a line with MULTIPLE fields to WRAP ?
    Good afternoon everyone...
    THE PROBLEM: Why doesn’t a line with multiple fields WRAP?
    HYPOTHETICAL EXAMPLE/WHAT I”D LIKE TO SEE
    If I have 2 fields on a line (this is now a hypothetical example and nothing to do with my actual report)….let’s call them field A and field B. And if field A has values of all ‘X’ and field B has values of all ‘Y’…then….the normal case would be (ignore dots – only for spacing):
    A……………………… B
    XXXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYY
    But what if A is too long? I would want to see B wrap onto the next line like this:
    A……………………………………………………B
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX YYYYYY
    YYYYYYYYYYYYY
    And similarly….if B is extra long, can the line print as:
    A………………………. B
    XXXXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    I don’t want the case where B is long and I get:
    A………………… …B…
    XXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYYYYY
    ………………………..YYYYYYYYYYYYYYYYYYYYY
    I can see how you can wrap an individual field like that…but how can you WRAP a line of[b] fields within the frame so it wraps to the BEGINNING of the frame on next line?
    My SPECIFIC CASE
    I have a report that I have stripped down to a simple structure for the purposes of this explanation.
    My DATA MODEL has the main QUERY (for plant family and species data). The columns of the query are divided into 2 groups. The 1st GROUP contains the family data. Below that is the rest of the species data in a 2nd GROUP.
    Linking from the 2nd species group (above) is a new QUERY to extract REGION data based on the common key field. Under this 2nd query is another group with all the REGION columns.
    The LAYOUT MODEL has a group frame (the main , base one)
    On top of this is a repeating frame based on the 1st group (family data).
    On top of this is another repeating frame for the 2nd group (species data).
    On top of this is 2 Frames on the same line line. The 1st frame contains columns from the species group .
    The 2nd frame on this line is a repeating frame. The PRINT DIRECTION for this frame is ACROSS/DOWN. It repeats details of the REGION where the species is found. These columns come from this group come from the REGION QUERY and GROUP.
    All fields on the report line have variable horizontal elasticity.
    The problem is that when there is too much data on the line, it does NOT WRAP to the 2nd line.. It TRUNCATES.
    Can the line be made to WRAP????..
    In my current report, 1 of 2 things is happening:
    1) All fields print on the line until it hits the page boundary and then it just stops. Truncated!
    2) All fields print on the current line, then Oracle Reports throws a new page to print the REMAINDER of the long, input line
    But I would like a LONG line to continue printing onto the following line of the same page.
    I have tried all combinations of the elasticity fields and the ‘ADVANCED LAYOUT’ properties.
    I have been focussing my attention with this problem on the frames .
    We are using REPORT BUILDER V 6.0.8.26.0
    Thankyou to anyone who may offer assistance.
    Tony Calabrese.

    Steve,
    you gain 1 thing, but you lose something else!
    This thing is SO frustrating!
    Hey Steve! Good afternoon.
    I've done as you suggested....I have a long text boilerplate item - the only 1 on the line...and it has all the column in it.
    So it looks like:
    &col1 &col2 &col3 &col4 &col5 etc etc etc
    And the line expands nicely to each field's requirements.
    And when it gets to the right page boundary...it WRAPS to the next line! Beautiful!!!
    The only thing is that...when I had individual fields across the line I was able to create format triggers for those fields. And in doing so I was able to reduce the font and change the justification. I had to do that because some of the fields had to appear superscripted.
    So I wanted something like (ignore the dots):
    ...................................ppppp
    AAAA BBBB CCCCC DDDD EEEE FFFFFF
    So the field of 'ppppp' appeared slightly higher on the line than the other fields...
    I can't see how I can do this with a single TEXT field containing all the &COL values.
    Have you ever come across anything like this?
    Thankyou again,
    Tony Calabrese 12/4/2007

  • Maintenance View with Subset Fields

    Hi All,
    I have created a maintenance view based on a single DB table. Two key fields are defined to be as subset fields. No selection conditions are added to the view. I have used table maintenance genrator to define the screen (one step) along with the events.
    In SM30, i get the popup to fill the subset fields.
    I have created an event for AA (to replace default read). I am filling total attribute here.
    a) Is there some other attribute that i need to fill apart from total?
    I receive following dump
    " Exception condition "NO_VALUE_FOR_SUBSET_IDENT" is raised"
    When i set <status>-sbsid_rcvd = 'R' in read routine along with total, then the above exception doesn't appear.
    But filtering based on the subset values doesn't happen automatically.
    b) I also need have to have routines to perform insert, copy and validation.
    c) Would the contents displayed be automatically filtered based on the subset values or we need to process this in user routines for read and so on?
    As i find very limited documentation available for maintenance views with subset fields, could you suggest me some example to do the above?
    Thanks in Advance,
    Regards,
    Rekha

    Hello Rekha,
    Yes I've same idea, documentation for maintenance screens is inadequate.
    But there is way to find examples for all events,
    table TVIMF is storing the Table name - Event - Form name columns.
    For example when u want to  do something about  "creating a new entry"
    Just go se11 > Table maintenance generator and find related event : 05
    - Then go to TVIMF and display a record for event = 05
    - than go to function group of  maintenance screen of the TABLE in that record
    - find the subroutine form ( TVIMF-FORMNAME) in that function group
    This is a working example for that event, try or copy & use.
    I hope it helps you for the coding for all the events.
    Bulent
    Edited by: Bulent Balci on Aug 5, 2010 11:28 PM
    Edited by: Bulent Balci on Aug 5, 2010 11:29 PM

  • How to create a dimension object in SAP BW Unv with Null value

    Hello,
    for query syncronisation task, I need a dimension object in my BW universe with NULL value. Does someone know, how to do it or if its possible?
    Regards,
    Thilo

    Hi Thilo,
    so the only common item is Material then - correct ?
    Query 1                                                                                Query 2
    Formulation (grouping of materials)                                                  (No counterpart)
    Material                                                                                Material
    dummy key figure (why?)                                                                Company Code
                                                                                    10 Keyfigure
    Is this something you regular have to do ? what about a MultiProvider ?
    did you try "merged dimensions" in the Web Intelligence Report ?
    Ingo

  • How to allocate a text value to a null field in a cross tab

    Hi there,
    I'm using Crystal 2008 and have created a report that retrieves support tickets assigned by team within a specific date field. I've added a cross tab that is retrieving the data correctly. However, if the team field is blank, the cross tab comes up with a blank field - something similar to :
    Team name       # Tickets Assigned
    Team 1  -
    >  10
    Team 2  -
    >  20
    >  15
    Team 3  -
    >  12
    Team 4   -
    > 18
    I would like to be able to have it returned <Unassigned> instead of just white space. Any suggestions on where to begin? I am a beginner at this and would appreciate any help at all.

    instead of using just the value create a formula that will deal with nulls.
    something along the lines of:
    if isnull()
    then "<Unassigned>"
    else ()
    hope that helps
    Dom Horton

  • Sql query slowness due to rank and columns with null values:

        
    Sql query slowness due to rank and columns with null values:
    I have the following table in database with around 10 millions records:
    Declaration:
    create table PropertyOwners (
    [Key] int not null primary key,
    PropertyKey int not null,    
    BoughtDate DateTime,    
    OwnerKey int null,    
    GroupKey int null   
    go
    [Key] is primary key and combination of PropertyKey, BoughtDate, OwnerKey and GroupKey is unique.
    With the following index:
    CREATE NONCLUSTERED INDEX [IX_PropertyOwners] ON [dbo].[PropertyOwners]    
    [PropertyKey] ASC,   
    [BoughtDate] DESC,   
    [OwnerKey] DESC,   
    [GroupKey] DESC   
    go
    Description of the case:
    For single BoughtDate one property can belong to multiple owners or single group, for single record there can either be OwnerKey or GroupKey but not both so one of them will be null for each record. I am trying to retrieve the data from the table using
    following query for the OwnerKey. If there are same property rows for owners and group at the same time than the rows having OwnerKey with be preferred, that is why I am using "OwnerKey desc" in Rank function.
    declare @ownerKey int = 40000   
    select PropertyKey, BoughtDate, OwnerKey, GroupKey   
    from (    
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,       
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]   
    from PropertyOwners   
    ) as result   
    where result.[Rank]=1 and result.[OwnerKey]=@ownerKey
    It is taking 2-3 seconds to get the records which is too slow, similar time it is taking as I try to get the records using the GroupKey. But when I tried to get the records for the PropertyKey with the same query, it is executing in 10 milliseconds.
    May be the slowness is due to as OwnerKey/GroupKey in the table  can be null and sql server in unable to index it. I have also tried to use the Indexed view to pre ranked them but I can't use it in my query as Rank function is not supported in indexed
    view.
    Please note this table is updated once a day and using Sql Server 2008 R2. Any help will be greatly appreciated.

    create table #result (PropertyKey int not null, BoughtDate datetime, OwnerKey int null, GroupKey int null, [Rank] int not null)Create index idx ON #result(OwnerKey ,rnk)
    insert into #result(PropertyKey, BoughtDate, OwnerKey, GroupKey, [Rank])
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
    from PropertyOwners
    go
    declare @ownerKey int = 1
    select PropertyKey, BoughtDate, OwnerKey, GroupKey
    from #result as result
    where result.[Rank]=1
    and result.[OwnerKey]=@ownerKey
    go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Sync Error !!!!

    I do not sync, no need to But an "error while trying to sync audio and midi" message/window came up this morning after I launched Logic!? What does that mean? Also, my logic has quit unexpectedly already 4 ~5 times!! I mean each time it did this, yes

  • IPod Nano synching error 13019

    I've seen this error message in other posts and (I think) I've tried all the suggestions to no avail.  My issue is that I didn't start getting this error until I switch to an iPhone a couple of months ago.  Everything synchs properly to the iPhone, b

  • Click to Call for Google Chrome not appearing

    So I downloaded the most recent version of Click to Call and was able to enable this feature finally in IE. However, whenever I seek to do the same in Chrome (ver. 35) by going to Settings > Extensions, there is no Extension there to enable. have tri

  • Black Ink doesn't work

    I changed color cartridges because they were empty.  Black ink is full.  printer diagnostic says printer is fine, but black ink doesn't print.

  • Accessing Runtime Constants in PCK

    Hi all Anybody tried accessing runtime constants such as message ID  in PCK, successfully? I have written a java mapping using StreamTransformationConstants class to retrieve MessageId value. The same java mapping works fine in XI, but not PCK. Any i