Get Distinct records with a condition

I have a table with multiple records per Person and an active status column. I would like to fetch distinct records by PersonID and PersonName but also return active status with a condition that if person is active on at least one he is considered active.
Here is my table.
DECLARE @Person TABLE (PersonID INT, PersonName VARCHAR(50), DeptName VARCHAR(50), Active bit)
INSERT INTO @Person (PersonID, PersonName, DeptName, Active) VALUES (111, 'John', 'Finance', 0), (111, 'John', 'HR', 1),(222, 'Jack', 'Payroll', 0),(333, 'Mark', 'Facilities', 1),(444, 'Bill', 'IT', 0),(444, 'Bill', 'HR', 1),(444, 'Bill', 'Finance', 1)
My resultset after the query should be as follows.
(111, 'John', 1),(222,'Jack',0),(333,'Mark',1),(444,'Bill',1)
Thanks for the help.

>> I have a table with multiple records [sic] per Person and an active status column. <<
Rows are not records. Tables have to have a key by definition and since they model a set, the names are plural or collective. These are fundamentals that were covered in the first few chapters of any book on RDBMS. You do not know ISO-11179 naming rules. 
You still use assembly language bit flags in SQL! A status is a state of being so it requires a temporal component. Do you really know people with FIFTY character name? Even in Poland and India, that is not likely. But when you allow garbage data, you will
get it. 
Identifiers are CHAR(n), not numeric; what math do you do with them? Again, this is a fundamental of data modeling. 
You are simply reenforcing your bad habits and not taking the time to learn how to do RDBMS correctly. 
CREATE TABLE Personnel --- collective name!
(person_id CHAR(3) NOT NULL,
 person_name VARCHAR(10) NOT NULL, 
 dept_name VARCHAR(10)NOT NULL, 
 hire_date DATE NOT NULL,
 termination_date DATE,
 CHECK (hire_date < termination_date),
 PRIMARY KEY (person_id, hire_date));  -- null means current.
See how a valid design makes finding a status possible? And it shows us just what a mess you have! Bill is working in TWO departments! See how the key prevents this error? We should add more constraints, but I do not think you are ready for that yet. 
SELECT person_id, person_name, dept_name AS current_dept_name
  FROM Personnel 
 WHERE termination_date IS NULL;
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • Query to get the records with same last name

    I need to write a single sql query to get all records with duplicate last_name's. For example, if tab1 has 4 records:
    10     Amit     Kumar
    20     Kishore          Kumar
    30     Sachin     Gupta
    40     Peter     Gabriel
    then the query should return
    10     Amit     Kumar
    20     Kishore     Kumar
    id, name,L_name being the 3 columns in table
    Apprecite you help.
    Thank you
    Mary

    SQL> create table mytable (id,name,l_name)
      2  as
      3  select 10, 'Amit', 'Kumar' from dual union all
      4  select 20, 'Kishore', 'Kumar' from dual union all
      5  select 30, 'Sachin', 'Gupta' from dual union all
      6  select 40, 'Peter', 'Gabriel' from dual
      7  /
    Table created.
    SQL> select id
      2       , name
      3       , l_name
      4    from ( select t.*
      5                , count(*) over (partition by l_name) cnt
      6             from mytable t
      7         )
      8   where cnt > 1
      9  /
                                        ID NAME    L_NAME
                                        10 Amit    Kumar
                                        20 Kishore Kumar
    2 rows selected.Regards,
    Rob.

  • Distinct records with conditional select formula

    Post Author: nelsonchris
    CA Forum: Data Connectivity and SQL
    Hello,
    I have a simple report pulling data from two tables. I want
    only distinct records. I am selecting records based on
    parameters; here is the select formula:
    ({?Service Name} = "*" or {selsvc.ServiceName} like
    {?Service Name})and
    ({?Program Name} = "*" or {selsvc.Selected Service Entry 
    Program Name} like {?Program Name}) and
    ({?Agency Name}  = "*" or {selsvc.Selected Service Entry 
    Agency Name} like {?Agency Name})
    The problem comes from the fact that Crystal will add the
    selsvc fields to the reports SQL select code, which has the
    effect of duplicating some records that do not have the same
    values for the selsvc fields. The select formula above is
    the only place in the report where values from the selsvc
    field are used, and as you can see they are only used when
    the user has submitted a matching parameter for them. I can
    not figure out how to get rid of the duplicates, please
    help!
    Thanks for your time,
    Chris

    Post Author: yangster
    CA Forum: Data Connectivity and SQL
    I don't follow why you are getting duplicates with your selectionare you getting duplicates without the selection criteria?if you are then they really are not duplicates and there could be issues with your joins between the 2 tables

  • Query to get the record with latest date

    I have
    ACCOUNT_TABLE
    account_number
    account_event
    event_date
    ACCOUNT_TABLE
    1,Open,12 Jan 2006
    1,Open,13 Jan 2006
    1,Open,14 Jan 2006
    1,Open,15 Jan 2006
    1,Open,16 Jan 2006
    How can I get the latest record(16 Jan 2006) in one sql statement.
    Thx
    m

    if you have more account_event's then...
    SQL> with t as
      2   (select 1 account_number,'Open' account_event,'12 Jan 2006' event_date from dual union all
      3   select 1,'Open','13 Jan 2006' from dual union all
      4   select 1,'Open','14 Jan 2006' from dual union all
      5   select 1,'Open','15 Jan 2006' from dual union all
      6   select 1,'Open','16 Jan 2006' from dual union all
      7   select 1,'Close','17 Jan 2006' from dual union all
      8   select 1,'Close','18 Jan 2006' from dual union all
      9   select 2,'Open','19 Jan 2006' from dual)
    10   select * from t a
    11   where (a.account_number, account_event,a.event_date) in
    12   ((select b.account_number, account_event,max(b.event_date) from t b group by b.account_number,account_event))
    13  order by account_number;
    ACCOUNT_NUMBER ACCOU EVENT_DATE
                 1 Close 18 Jan 2006
                 1 Open  16 Jan 2006
                 2 Open  19 Jan 2006

  • Getting Multiple Records with Same Key throws Access Violation

    Are there any known issues with PInvoke Signatures for GET .. Im gettign consistently AVL's when attempting to read Multiple Values under single key ..
    Error doesn't happens while debugging in VS 2007 , Tried turning off optimizations with no luck ..
    Im using VS 2010 and .NET 4.0 ( WIN XP) . I do have a repro. ( Im using latest bits from Oracle site as of 9/10/2010 )
    Unhandled Exception: System.AccessViolationException: Attempted to read or write
    protected memory. This is often an indication that other memory is corrupt.
    at BerkeleyDB.Internal.libdb_csharpPINVOKE.db_strerror(Int32 jarg1)
    at BerkeleyDB.DatabaseException..ctor(Int32 err) in C:\Users\gmf\db\db-5.0.26
    \csharp\DatabaseException.cs:line 78
    at BerkeleyDB.DatabaseException.ThrowException(Int32 err) in C:\Users\gmf\db\
    db-5.0.26\csharp\DatabaseException.cs:line 34
    at BerkeleyDB.Internal.DB.get(DB_TXN txn, DatabaseEntry key, DatabaseEntry da
    ta, UInt32 flags) in C:\Users\gmf\db\db-5.0.26\csharp\Internal\DB.cs:line 187
    at BerkeleyDB.BaseDatabase.Get(DatabaseEntry key, DatabaseEntry data, Transac
    tion txn, LockingInfo info, UInt32 flags) in C:\Users\gmf\db\db-5.0.26\csharp\Ba
    seDatabase.cs:line 900
    at BerkeleyDB.Database.GetMultiple(DatabaseEntry key, Int32 BufferSize, Trans
    action txn, LockingInfo info) in C:\Users\gmf\db\db-5.0.26\csharp\Database.cs:li
    ne 494
    at helloworld.Program.Main(String[] args) in C:\bdm\helloworld\helloworld\Pro
    gram.cs:line 53
    Appreciate any help.
    Thanks
    Nirmal
    Edited by: user8050299 on Sep 10, 2010 3:29 PM
    Updated with OS

    seems like oracle .NET bindings doesnt work for new CLR . It works fine with .NET 2.0
    May be Oracle folks will release new version for 4.0

  • Distinct records based on condition within a table

    Hello PL/SQL Gurus/experts,
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
    I have following table -
    Note - Table don't have any primary key on Order_ID -
    DROP TABLE T;
    create table T(Order_ID,Active_Flg) as select
    '201002', 'Y' from dual union all select
    '201002', '' from DUAL union all select
    '201003', '' from dual union all select
    '201004', 'Y' from DUAL union all select
    '201004', '' from dual union all select
    '201005', '' from DUAL ;I want to fetch those Order_ID which have Active-Flg as NULL and don't have the entry for Active_Flg=Y
    If use the following then it returns the distinct Order_ID but not the expected one -
    SELECT DISTINCT ORDER_ID FROM T WHERE ACTIVE_FLG IS NULL;Result -
    ORDER_ID
    201004
    201002
    201003
    201005Kindly help.....

    try this
    with t as
    select
    '201002' order_id, 'Y' active_flg from dual union all select
    '201002', '' from DUAL union all select
    '201003', '' from dual union all select
    '201004', 'Y' from DUAL union all select
    '201004', '' from dual union all select
    '201005', '' from DUAL
    select order_id
      from (
              select
                order_id,
                active_flg,
                count(case when active_flg =  'Y' then 1 end) over(partition by order_id) cntY
              from t
    where cntY = 0 and active_flg is null

  • Formula help - Distinct Count with 3 conditions

    I have a field named ID
    I need to Dcount records where Dorder = 1,0 or null
    I'm gonna need to perform similiar totals on other fields so I don't think I can use Record Select Expert (Is that right?)
    Thanks
    Steve

    Steve,
    Do a search in CR's online help for DistinctCount. It should have what you are looking for.
    Basically you'l want something like this...
    DistinctCount({TableName.FieldToCount}, {TableName.Order} = 1)
    DistinctCount({TableName.FieldToCount}, {TableName.Order} = 0)
    DistinctCount({TableName.FieldToCount}, IsNull({TableName.Order}))
    HTH,
    Jason

  • Get distinct records if more than one select column

    Hi,
    I have a table .
    ParentId
    refid
    TaskNo
    [TaskOwner]
    [UpdatedBy]
    Remarks
    Description
    100
    NULL
    100
    user2
    user2
    hi
    hi
    100
    100
    100.1
    user1
    user1
    this 
    this 
    100
    100.2
    100.2.1
    user2
    user1
    is 
    is 
    101
    NULL
    101
    user1
    user2
    the 
    the 
    102
    102
    102.1
    user2
    user2
    rem
    desc
    103
    103.1
    103.1.2
    user1
    user1
    rem1
    desc1
    Previously I able to show parentid where refid is null , but now I would like to show 102,103 values also.
    Desired result :
    ParentId
    refid
    TaskNo
    [TaskOwner]
    [UpdatedBy]
    Remarks
    Description
    100
    NULL
    100
    user2
    user2
    hi
    hi
    101
    NULL
    101
    user1
    user2
    the 
    the 
    102
    102
    102.1
    user2
    user2
    rem
    desc
    103
    103.1
    103.1.2
    user1
    user1
    rem1
    desc1
    Please help me to write query..
    Thank you.

    Thank you Visakh16..
    I got solution ..
      seq=4 for the record is nothing but sql is partitioning records first and filtering .
    If i move the filter inside and working is fine..
    SELECT Seq,ParentId,refid,TaskNo,TaskOwner,UpdatedBy,Remarks
    FROM
    SELECT *,ROW_NUMBER() OVER (PARTITION BY ParentId ORDER BY refid) AS Seq
    FROM [t_TaskMaster] WHERE STATUS NOT IN ('Deleted', 'Completed', 'Closed') AND [TaskOwner] = @UserName
    AND UpdatedBy <> @UserName
    )t
    WHERE Seq=1
    Filter should be inside only
    As ROW_NUMBER logic should be applied only after filtering. otherwise you'll miss required records
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • "How to get distinct values of sharepoint column using SSRS"

    Hi,
        I have integrated sharepoint list data to SQL Server reporting services. I am using the below to query sharepoint list data using sql reporting services.
    <Query>
       <SoapAction>http://schemas.microsoft.com/sharepoint/soap/GetListItems</SoapAction>
       <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
          <Parameters>
             <Parameter Name="listName">
                <DefaultValue>{GUID of list}</DefaultValue>
             </Parameter>
             <Parameter Name="viewName">
                <DefaultValue>{GUID of listview}</DefaultValue>
             </Parameter>
             <Parameter Name="rowLimit">
                <DefaultValue>9999</DefaultValue>
             </Parameter>           
          </Parameters>
       </Method>  
    <ElementPath IgnoreNamespaces="True">*</ElementPath>
    </Query>
    By using this query, I am getting a dataset which includes all the columns of sharepoint list. Among these columns, I wanted to display only 2 columns (i.e Region and Sales type) using chart. I have created a Region parameter but when I click preview, the drop down box is giving me all the repeatative values of region like RG1,RG1,RG1,RG2,RG2,RG2,RG2,RG3.......... I wanted to display only distinct values of Region parameter so that whenever end user select region from the parameter drop down, it will display the respective value of Sales type column.
    Also when I select only RG1 parameter, it is giving me a chart including the sales type of all the Regions. (it should display me only the sales type of RG1) How can I link these 2 columns so that they will display the values respectively.
              I would really appreciate if anyone can help me out with this.
    Thanks,
    Sam.

    Hi Sam,
    By code, the CAML language doesn’t have any reserved word (or tag) to set this particular filter to remove duplicate results.
    In this case, we could use the custom code to get distinct records.
    Here are the detailed steps:
    1.         Create a hidden parameter that gets all the records in one field.
    Note: Please create another dataset that is same of the main dataset. This dataset is used for the parameter.
    2.         Create a function that used to remove the duplicate records.
    Here is the code:
    Public Shared Function RemoveDups(ByVal items As String) As String
    Dim noDups As New System.Collections.ArrayList()
    Dim SpStr
    SpStr = Split(items ,",")
    For i As Integer=0 To Ubound(Spstr)
    If Not noDups.Contains(SpStr(i).Trim()) Then
    noDups.Add(SpStr(i).Trim())
    End If
    Next
    Dim uniqueItems As String() = New String(noDups.Count-1){}
    noDups.CopyTo(uniqueItems)
    Return String.Join(",", uniqueItems)
    End Function
    3.         Create another parameter that will be used for filtering the maindata.
    Please set the available value to be =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",")
    And the default value to be the value you what such as the first value:
    =Split(Code.RemoveDups(JOIN(Parameters!ISSUE_STATUS_TEMP.Value, ",")), ",").(0)
    4.         Go to the main dataset. Open the property window of this dataset.
    5.         In the “Filters” tab, set the filter to be:
    Expression: <The field to be filter>
    Operator: =
    Value: =Parameters!Region.Value
    The parameter “Region” should be the parameter we created in the step3.
    Now, we should get distinct values of SharePoint columns.
    If there is anything unclear, please feel free to ask.
    Thanks,
    Jin
    Jin Chen - MSFT

  • How can I  delete and update records using where conditions?

    I want to delete and update the coherence records with some conditions, I describe it to use SQL as follows:
    delete from "contacts" where getStreet() = "dsada";
    update contacts set getStreet() = "dddd" where getCity() = "ssss";
    Can I use the filter like query to achieve this requirement as follows:
    ValueExtractor::View vHomeStateExtractor = ChainedExtractor::create(
    ChainedExtractor::createExtractors("getHomeAddress.getState"));
    Object::View voStateName = String::create("MA");
    Set::View setResults = hCache->entrySet(
    EqualsFilter::create(vHomeStateExtractor, voStateName));
    I know I can use get and put to achieve this requirement , but it Requires a two-interaction between the client and coherence server. Does it have And another way?
    Thanks very much, and please Forgive my English is not very good.

    Hi,
    You have a couple of options for updating or deleting using a Filter.
    For deleting you can use an Entry Processor and the cache invokeAll method. Using "out of the box" Coherence you can use the ConditionalRemove entry processor. I'm a Java person so the C++ below might not be exactly right but you should get the idea.
    ValueExtractor::View vHomeStateExtractor = ChainedExtractor::create(
    ChainedExtractor::createExtractors("getHomeAddress.getState"));
    Object::View voStateName = String::create("MA");
    hCache->invokeAll(EqualsFilter::create(vHomeStateExtractor, voStateName),
    ConditionalRemove::create(AlwaysFilter.getInstance());For update you would either need to write custom Entry Processor implementations that perform the updates you require or you can use out of the box POF or Reflection ValueUpdaters that update specific fields of the entries in the cache. These valueUpdaters would be wrapped in an UpdaterProcessor so the call would be very similar to the code above.
    JK

  • Cannot get wanted data with MAX and GROUP BY function

    Hi
    All
    I have a table like below:
    COLUMN     TYPE
    USER_ID     VARCHAR2 (10 Byte)
    PROCESS_ID     VARCHAR2 (30 Byte)
    END_TIME     DATE(STAMP)
    TO_LOC     VARCHAR2 (12 Byte)
    TO_LOC_TYPE     VARCHAR2 (15 Byte)
    FROM_LOC      VARCHAR2 (12 Byte)
    ITEM_ID     VARCHAR2 (25 Byte)
    CASES     NUMBER (12,4)
    LMS_UDA1      VARCHAR2 (250 Byte)
    ZONE     VARCHAR2 (2 Byte)
    I only want get one record with all columns, only have one clause MAX(END_TIME)
    But the other column have difference value.
    when i use MAX(END_TIME) and GROUP BY USER_ID,PROCESS_ID,CASES,....
    the sql didnot give one record,
    It give many records
    Please help me on this
    Regards
    Saven

    Hi, Saven,
    Sorry, it's unclear what you want.
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    If you can show your proiblem using commonly available tables, like those in the scott or hr schamas, then you don't have to post any sample data: just the results and the explanation.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    Are you trying to see all data related to the highest (that is, latest) end_time?
    I think you want something like this, that finds all the ionformation about the employee with the latest hiredate:
    WITH     got_r_num     AS
         SELECT     emp.*
         ,     ROW_NUMBER () OVER (ORDER BY  hiredate  DESC  NULLS LAST)
                   AS r_num
         FROM     scott.emp
    SELECT     *     -- Or list all columns except r_num
    FROM     got_r_num
    WHERE     r_num     = 1
    ;What do you want in case of a tie, that is, if 2 or more rows have the same latest end_time? You may need to add tie-breaking expressions to the analytic ORDER BY clause, and/or use RANK instead of ROW_NUMEBR

  • How can I get the number of distinct records that each field of a DB table has?

    Hi everyone,
    I would like to know how to get he number of distinct records that each field of a DB table has. When tracing a SQL statement either in ST12 or ST05, in the plan execution, if the sentence made useage of an index, then I can click in the index name and see this kind of information (no. of distinct values for each field of that index).
    Can I do something like this but with the whole fields of a table?
    What I have found until now is in Tx ST10; I search for whatever kind of table statistics and then use the function of "Analyze table" (which takes me to Tx DB05). In here, I can enter a table and up to 5 fields in order to get the information that I want.
    Is there any other way to do this?
    Regards,
    David Reza

    Hi David,
    You can export the same to excel and sort as per requirement.
    Sorry is that what you are looking for ?
    Regards,
    Deepanshu Sharma

  • Select distinct records in Mapping with no Key field (all fields can vary)

    Hi Experts,
    Let me take an example (not the actual requirement but same scenario) to explain the problem where I need your help to get best possible way to resolve. This has to be achieved in mapping, don't have other options as its part of complex end 2 end scenario.
    I have following input XML:
    <Employee>
       <Details>
          <Id>123</Id>
          <Name>ABC</Name>
         <Role>Manager</Role>
          <Area>Bangalore</Area>
        </Details>
        <Details>
           <Id>123</Id>
           <Name>ABC</Name>
            <Role>Manager</Role>
             <Area>Pune</Area>
         </Details>
          <Details>
           <Id>123</Id>
           <Name>ABC</Name>
            <Role>Advisor</Role>
             <Area>Bangalore</Area>
         </Details>
          <Details>
           <Id>123</Id>
           <Name>ABC</Name>
            <Role>Manager</Role>
             <Area>Bangalore</Area>
           <Details>
           <Id>143</Id>
           <Name>ABC</Name>
            <Role>Manager</Role>
             <Area>Bangalore</Area>
         </Details>
    </Employee>
    The output XML is:
    <Employee>
       <MainRec>
           <Id>123</Id>
            <Name>ABC</Name>
             <table name = 'Roles'>
                   <record>
                          <Id>123</Id>
                           <Role>Manager</Role>
                            <Area>Bangalore</Area>
                      </record>
                      <record>
                          <Id>123</Id>
                           <Role>Manager</Role>
                            <Area>Pune</Area>
                      </record>
                      <record>
                          <Id>123</Id>
                           <Role>Advisor</Role>
                            <Area>Bangalore</Area>
                      </record>
                  </table>
          </MainRec>
          <MainRec>
            <Id>123</Id>
            <Name>ABC</Name>
             <table name = 'Roles'>
                   <record>
                          <Id>143</Id>
                           <Role>Manager</Role>
                            <Area>Bangalore</Area>
                      </record>
                </table>
            </MainRec>
    </Employee>
    As you can see from the example above, here I want to populate only distinct records under table, but there is no key fiield to ditunguish. Any of the 3 fields (Id, Role,Area) can vary and between 2 records if all of these fields are same then its duplicate else select it. So in above XML just discard the 4th record from the source XML and populate all others. Each record has to be checked against all other records all 3 values (ID, Role, Area). Only when none of the records have exactly the same values, populate it.
    Also records with different ID come under different table node. Hope my requirement is clear, if not please let me know, i will try to explain better.
    I thought of creating a UDF to achieve this but not able to decide how to match it to the output message here.
    Best Regards,
    Pratik

    Hi,
    For the main record, I think you only need to check for each unique ID, e.g
    Id --> removeContext --> sort:ascending --> splitByValue:valueChanged --> collapseContext --> MainRec
    For the record, however, you need to create a UDF that will filter out the duplicate values. For this, the UDF sample mentioned here contained multipleResult lists
    Id --> removeContext --> concat: : --> concat: : --> UDF --> splitByValue:ValueChanged --> record
    role --> removeContext --> /          /                \ --> Id
    area --> removContext -------------> /                  \ --> role
                                                             \ --> area
    Context type UDF
    Arguments: input
    Result: IdResult
    Result: roleResult
    Result: areaResult
    Vector temp = new Vector();
    for(int a=0;a<input.length;a++){
       if(!temp.contains(input[a])
             temp.add(input[a]);
    for(int a=0;a<temp.size();a++){
       String tmp = (String) temp.get(a);
       /*split according to field */
       IdResult.addValue(tmp.substring(0,tmp.indexOf(":")));
       roleResult.addValue(tmp.substring(tmp.indexOf(":")+1,tmp.lastIndexOf(":")));
       areaResult.addValue(tmp.substring(tmp.lastIndexOf(":")+1,tmp.length()));
    note: Id and record will both be using the IdResult list.
    Hope this helps,
    Mark

  • How to create a service product with a condition record?

    Hi all
    I'm quite new to CRM programming and I now need to create a service product with a condition record. For creating the product I use function COM_PROD_SERVICE_MAINTAIN_API and it creates a product propperly. The function offers parameter IT_CONDITIONS for creating conditions. But when you have a look at type COM_PRODUCT_CND_API_TAB of the parameter, then you will find a deeep tabletype with lots(!) of additional tables. In the conditions tab of the product I simply enter a Condition Type, a Sales Organization, a Distribution Channel, an Amount, a Currency and a Unit and everything is fine after saving.
    Can anyone of you help me in how to set up parameter IT_CONDITIONS to get the above values into the product?
    Thanks fou you help,
    Michael Drechsler

    Hi,
    The link is https://support.oracle.com , you will have to request Oracle to link your user with your company support account.
    Cheers,
    Vlad

  • How to get distinct data if the query contains a column with Long Datatype?

    How can we select distinct records based on a LOng column

    From the Oracle 9i SQL Reference:
    LONG columns cannot appear in certain parts of SQL statements:
    n GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the
    DISTINCT operator in SELECT statements
    n The UNIQUE operator of a SELECT statement
    n The column list of a CREATE CLUSTER statement
    n The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
    n SQL built-in functions, expressions, or conditions
    n SELECT lists of queries containing GROUP BY clauses
    n SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or
    MINUS set operators
    n SELECT lists of CREATE TABLE ... AS SELECT statements
    n ALTER TABLE ... MOVE statements
    n SELECT lists in subqueries in INSERT statements

Maybe you are looking for

  • Exchange rate coefficient on the basis of latest posting date in invoice.

    Hi, I have one query on posting date(picking of exchange rate coefficient from TCURR table) in invoice verification.  Please help. Conditions are-- vender and company code are not in same currencies(ex-USD and INR). exchange currencies are maintained

  • RFP for a project management system

    Hi,  I am asked to present points related to a project management system. CAn anyone advise on links which help me get all the data required to be asked as questions to the supplier about their project management system. Thanks mp

  • Question for Vikas re. row higlight en click on row

    Hello Vikas, <br>I liked the options I noticed on some of your reports where the rows get a different colour when you mouseover them and also the possibility to click anywhere in a row. <br>Can you please explain me in detail (step by step) how these

  • How can I edit navigation items outside of iWeb08?

    I created a website for a friend, published the site and then backed up the HTML files to an external disk. I've since re-formatted my iMac and installed 10.5 Now I need to remove pages from the site and have to edit a few areas of the pages but i ca

  • Full text index searching in large document sets

    I have been placed in charge of a digital PDF document library for a small biotech company. The library consists of about 1000 100-300 page .pdf documents which have been scanned and OCRed. In order to facilitate the full text searching of the docume