Query to get items in a subinventory with a zero quantity

Once an item has a zero quantity it is no longer displayed in the material workbench. I am looking for some guidance on a query that will get me this information to include the following:
Item Description
Item Number
Subinventory
Org
UOM
QTY = 0
Any help with a query of this nature would be appreciated.

Here is the query
select msi.segment1,msi.organization_id,sum(nvl(transaction_quantity,0)) from mtl_system_items_b msi,mtl_onhand_quantities moq
where moq.inventory_item_id (+) = msi.inventory_item_id
and moq.organization_id (+) = msi.organization_id
and msi.organization_id = &org_id
and exists (select 1 from mtl_material_transactions mmt
where mmt.organization_id = msi.organization_id and mmt.inventory_item_id = msi.inventory_item_id
and mmt.transaction_quantity !=0 )
group by msi.segment1,msi.organization_id,moq.subinventory_code
having sum(nvl(transaction_quantity,0)) = 0
Check the explain plan and cost before running the query
The exists clause restricts the records only to those items that had some transactions
Hope this helps
Sandeep Gandhi

Similar Messages

  • Query to get G/L accounts even with the Zero transactions

    Dear experts,
    i have tried a query as below
    SELECT T0.[AcctCode], T0.[AcctName], T0.[CurrTotal] AS 'Bank Balance', sum(T1.[Debit]) as 'Payment', sum(T1.[Credit]) as 'Collection' FROM OACT T0  LEFT OUTER
    JOIN JDT1 T1 ON T0.AcctCode = T1.Account WHERE T0.[AcctCode] in ('162016','162010','162011','162002','162003','161010') AND T1.RefDate BETWEEN '[%0]' AND '[%1]'
    GROUP BY T0.[AcctCode], T0.[AcctName], T0.[CurrTotal]
    My requirement is
    I have given 5 G/L accounts in where condition. I am getting the report only the account have debit or credit transaction.
    whereas i want account in report even if it has "0" as transaction within that period.
    Thanks in advance,
    dwarak
    Edited by: Dwarakanath.P on Nov 28, 2011 2:51 PM

    Dear Fasolis Vasilios,
    Still am getting only the account having debit or credit sum.
    like this
    #     Account Code     Account Name     Bank Balance     Payment     Collection
    1     161010     Cash A/C     -                        2,376.00                     0                             3,363.00                  
    2     162002     BNP Paribas - USD A/c      11,336,040.71        2,281,479.20     0
    3     162010     BNP Paribas - INR A/c      14,314,924.41        1,845,229.00     1,721,899.00
    4     162016     ING Vysya-CC A/c             98,653,514.21         908,598.70            565,601.00
    Other 2 account is missing since it has no debit and credit.
    Regards,
    Dwarak

  • CAML Query to get Items based on Year and Month From Date Column

    Hi All,
           * As we knew that there are default columns in calendar like Stattdate,Title,Location..etc.
            * I required the CAML Query to get the list items of calender of particular Month and Year,So that I can get number of items or evetns are in Calendar
    Can any one help me how can I do this using caml query
    Samar

    Hi Stuart,
                 Thanks for your response,I had chosen 2nd option of our above mention suggestion.But when I try to fetech the data from a calendar it is showing below error .I
    had checked the below code with oter lists by changing Type to text and it worked fine.Can you please help me how can I fetech for the calulated columns
    Error
    "One or more field
    types are not installed properly. Go to the list settings page to delete these
    fields. "
    Code:
     string year="2014";
                string month="February";
                SPSite mysite = SPContext.Current.Site;
                SPWeb myweb = mysite.OpenWeb();
                try
                    SPList mylist = myweb.Lists["Calendar"];
                    SPQuery myquery = new SPQuery();
                    myquery.Query = @"<Where>
                                          <And>
                                           <Eq>
                                             <FieldRef Name='Year'/>
                                             <Value Type='Calculated'>"
    + year + @"</Value>
                                          </Eq>
                                          <Eq>
                                             <FieldRef Name='Month'
    />
                                             <Value Type='Calculated'>"
    + month + @"</Value>
                                          </Eq>
                                         </And>
                                      </Where>";
                    SPListItemCollection totaltiems = mylist.GetItems(myquery);
                   Label1.Text= "Total Number of Items is "+" "+totaltiems.Count.ToString();
                catch (Exception ee)
                    Label1.Text = ee.Message;
                finally
                    myweb.Dispose();
    Calculated Columns
    Samar

  • Query to get Item revision Mismatch

    Dear Guru's,
    Need your help. I am looking for a queryo get those below details.
    1) Need a query which should give item revisions which are not match with 2 orgs. Ex:: We have two orgs p001 & P002 and we are seeing few item revision is same for p001 & p002 and few items are not matching with p001 item revisions. Please help me to prepare a query which will give the mismatch item details along with item revisions.
    --> in P001 the item revision is 0, 001, 002 & 003
    --> In P002 the item revision is only 0.
    i need those mismatc records where the item revision does not match with p001 to p002 item revisions.
    Thanks in advance for the help.
    Regards,
    SSP

    Hi ,
    This??  This is the Sample one  or other wise give me sample data scripts create & insert commands or post in SQL and PLSQL Forum
    SELECT A.* FROM sampl_table A
    WHERE  EXISTS (
        SELECT 1 FROM sampl_table B
        WHERE A.item_id = B.item_id
        AND ....
    AND NOT  EXISTS (
        SELECT 2 FROM sampl_table B
        WHERE A.item_id = B.item_id
        AND A.SDAY = B.SDAY
        AND .....
    or you use Joins

  • Performance of query for getting item revisions

    Hi All,
    The following query took several minutes in an environment with about 7,500,000 item revisions :
    SELECT
    MIR.INVENTORY_ITEM_ID
    , MSI.CONCATENATED_SEGMENTS ITEM_NUMBER
    , MIR.ORGANIZATION_ID
    , MP.ORGANIZATION_CODE
    FROM
    MTL_ITEM_REVISIONS_VL MIR
    , MTL_PARAMETERS MP
    , MTL_SYSTEM_ITEMS_VL MSI
    WHERE
    (MIR.INVENTORY_ITEM_ID = p_Item_ID OR MSI.CONCATENATED_SEGMENTS = p_Item_Number)
    AND (MIR.ORGANIZATION_ID = p_Org_ID OR MP.ORGANIZATION_CODE = p_Org_Code)
    AND MP.ORGANIZATION_ID = MIR.ORGANIZATION_ID
    AND MIR.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
    AND MIR.ORGANIZATION_ID = MSI.ORGANIZATION_ID ORDER BY EFFECTIVITY_DATE, REVISION DESC;
    If changing this query to the following, it takes less than a second:
    SELECT
    MIR.INVENTORY_ITEM_ID
    , MSI.CONCATENATED_SEGMENTS ITEM_NUMBER
    , MIR.ORGANIZATION_ID
    , MP.ORGANIZATION_CODE
    FROM
    MTL_ITEM_REVISIONS_VL MIR
    , MTL_PARAMETERS MP
    , MTL_SYSTEM_ITEMS_VL MSI
    WHERE
    MSI.CONCATENATED_SEGMENTS = p_Item_Number
    AND MP.ORGANIZATION_CODE = p_Org_Code
    AND MP.ORGANIZATION_ID = MIR.ORGANIZATION_ID
    AND MIR.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID
    AND MIR.ORGANIZATION_ID = MSI.ORGANIZATION_ID ORDER BY EFFECTIVITY_DATE, REVISION DESC;
    Can anyone explain the extreme difference in performance between these two queries?
    Thanks & Regards
    Carolin

    They don't look logically equivalent to me.
    Here are the differences:
    WHERE  (MIR.INVENTORY_ITEM_ID = p_Item_ID
            OR MSI.CONCATENATED_SEGMENTS = p_Item_Number)
    AND    (MIR.ORGANIZATION_ID = p_Org_ID
            OR MP.ORGANIZATION_CODE = p_Org_Code)
    vs
    WHERE  MSI.CONCATENATED_SEGMENTS = p_Item_Number
    AND    MP.ORGANIZATION_CODE = p_Org_CodeIf they aren't logically equivalent there's no point in comparing the performance.

  • Query-blocked Invoices for Quality per mat with the total quantity in QI

    Hello,
    We need to create a query for blocked Invoices in Quality summarized per materialcode together with the total quantity in Quality Inspection blocked stock.
    As starting point I've used the table RBKP_BLOCKED and linked it with RSEG from which I'm checking the quality block.
    From which table should I retrieve the qty in QI blocked stock?
    Thanks,
    Andrei J

    since ur report is depending on LIV's on block due to quality inspection is pending, better take the quantity from MKPF passing document number (GR number) and year of the document.
    Taking stock from MARD table will result is total mis match since this table holds stock position of plant and storage lcoation.
    Thanks & regards
    AHP

  • Query about getting Item cost value.

    Hi all,
    In SAP Business One, Items Master Data, there is a field
    Price List (Standard Price,Purchase Price,Last Purchase Price......) and corresponding Prices Listed for them.
    Which is the actual price of an Item or a product?
    Reply Soon
    Thanks in Advance
    Janakiraman

    Hi Janakiraman,
    I think you have misundertand something. What do you wanth to get? If you need to have one Base Price list, and then some other price lists based on this one, you could use any of the 10, and then on the derivated price lists say they are based on the Base Price list.
    But there isn´t any standard Base Price.
    Perhaps if you explain what you need(your goal), we could help you better.
    Regards,
    Ibai Peñ

  • Flashback query to get back a old table with data.

    Hi,
    By mistake i drop one table 20 days before so is it possible to get that table back using flashback query.
    if yes , can you give me some idea for that query.
    thanks for your support...

    Hi,
    Flashback is a 10g new Feature. The only solution in your case will be recover the table from a backup. If you have an exp backup just import the table back to the DB, if you have a RMAN backup you can perform an incomplete recovery (point-in-time recovery) to the time just
    before the drop in an auxiliary DB and exp/imp back the table to your DB.
    Cheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • How to get item stock from bin location with serial numbers?

    Dear experts
    I want to write query for getting item stock from bin location with serial numbers..
    Thank you
    Santosh Dhere.

    Hi Santosh,
    Try this:
    SELECT T0.[ItemCode], T5.[DistNumber], T5.[MnfSerial], T5.[LotNumber], T3.[OnHandQty]
      , T1.[BinCode], T1.[WhsCode]
    FROM  [dbo].[OIBQ] T0
      INNER  JOIN [dbo].[OBIN] T1  ON  T0.[BinAbs] = T1.[AbsEntry]  AND  T0.[OnHandQty] <> 0
      LEFT OUTER JOIN [dbo].[OBBQ] T2  ON  T0.[BinAbs] = T2.[BinAbs]  AND  T0.[ItemCode] = T2.[ItemCode]  AND  T2.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OSBQ] T3  ON  T0.[BinAbs] = T3.[BinAbs]  AND  T0.[ItemCode] = T3.[ItemCode]  AND  T3.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBTN] T4  ON  T2.[SnBMDAbs] = T4.[AbsEntry]  AND  T2.[ItemCode] = T4.[ItemCode]
      LEFT OUTER  JOIN [dbo].[OSRN] T5  ON  T3.[SnBMDAbs] = T5.[AbsEntry]  AND  T3.[ItemCode] = T5.[ItemCode]
    WHERE T1.[AbsEntry] >= (0)  AND  (T3.[AbsEntry] IS NOT NULL)
    UNION ALL
    SELECT T0.[ItemCode], T5.[DistNumber], T5.[MnfSerial], T5.[LotNumber], T0.[OnHandQty]
      , T1.[BinCode], T1.[WhsCode]
    FROM  [dbo].[OIBQ] T0
      INNER  JOIN [dbo].[OBIN] T1  ON  T0.[BinAbs] = T1.[AbsEntry]  AND  T0.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBBQ] T2  ON  T0.[BinAbs] = T2.[BinAbs]  AND  T0.[ItemCode] = T2.[ItemCode]  AND  T2.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OSBQ] T3  ON  T0.[BinAbs] = T3.[BinAbs]  AND  T0.[ItemCode] = T3.[ItemCode]  AND  T3.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBTN] T4  ON  T2.[SnBMDAbs] = T4.[AbsEntry]  AND  T2.[ItemCode] = T4.[ItemCode]
      LEFT OUTER  JOIN [dbo].[OSRN] T5  ON  T3.[SnBMDAbs] = T5.[AbsEntry]  AND  T3.[ItemCode] = T5.[ItemCode]
    WHERE T1.[AbsEntry] >= (0)  AND  (T2.[AbsEntry] IS NULL   AND  T3.[AbsEntry] IS NULL)
    UNION ALL
    SELECT T0.[ItemCode], T0.[SRNDistNumber], T0.[SRNMnfSerial], T0.[SRNLotNumber], T0.[IBQOnhandQty] - T0.[OnHandQty]
      , T0.[BinCode], T0.[WhsCode]
    FROM  (
      SELECT T0.[BinAbs], T0.[ItemCode], MAX(T0.[OnHandQty]) AS 'IBQOnhandQty', SUM(T2.[OnHandQty]) AS 'OnHandQty', N'' AS 'BTNDistNumber', N'' AS 'BTNMnfSerial'
      , N'' AS 'BTNLotNumber', N'' AS 'SRNDistNumber', N'' AS 'SRNMnfSerial', N'' AS 'SRNLotNumber', MIN(T5.[AbsEntry]) AS 'AbsEntry', MIN(T1.[BinCode]) AS 'BinCode'
      , 10000044 AS 'SnbType', MIN(T5.[AbsEntry]) AS 'BTNAbsEntry', MIN(T5.[AbsEntry]) AS 'SRNAbsEntry', MIN(T1.[WhsCode]) AS 'WhsCode', MIN(T1.[SL1Code]) AS 'SL1Code'
      , MIN(T1.[SL2Code]) AS 'SL2Code', MIN(T1.[SL3Code]) AS 'SL3Code', MIN(T1.[SL4Code]) AS 'SL4Code', MIN(T1.[SL1Abs]) AS 'SL1Abs'
      , MIN(T1.[SL2Abs]) AS 'SL2Abs', MIN(T1.[SL3Abs]) AS 'SL3Abs', MIN(T1.[SL4Abs]) AS 'SL4Abs'
      FROM  [dbo].[OIBQ] T0
      INNER  JOIN [dbo].[OBIN] T1  ON  T0.[BinAbs] = T1.[AbsEntry]  AND  T0.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBBQ] T2  ON  T0.[BinAbs] = T2.[BinAbs]  AND  T0.[ItemCode] = T2.[ItemCode]  AND  T2.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OSBQ] T3  ON  T0.[BinAbs] = T3.[BinAbs]  AND  T0.[ItemCode] = T3.[ItemCode]  AND  T3.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBTN] T4  ON  T2.[SnBMDAbs] = T4.[AbsEntry]  AND  T2.[ItemCode] = T4.[ItemCode]
      LEFT OUTER  JOIN [dbo].[OSRN] T5  ON  T3.[SnBMDAbs] = T5.[AbsEntry]  AND  T3.[ItemCode] = T5.[ItemCode]
      WHERE T1.[AbsEntry] >= (0 )  AND  (T2.[AbsEntry] IS NOT NULL)
      GROUP BY T0.[BinAbs], T0.[ItemCode]
      UNION ALL
      SELECT T0.[BinAbs], T0.[ItemCode], MAX(T0.[OnHandQty]) AS 'IBQOnhandQty', SUM(T3.[OnHandQty]) AS 'OnHandQty', N'' AS 'BTNDistNumber', N'' AS 'BTNMnfSerial'
      , N'' AS 'BTNLotNumber', N'' AS 'SRNDistNumber', N'' AS 'SRNMnfSerial', N'' AS 'SRNLotNumber', MIN(T4.[AbsEntry]) AS 'AbsEntry', MIN(T1.[BinCode]) AS 'BinCode'
      , 10000045 AS 'SnbType', MIN(T4.[AbsEntry]) AS 'BTNAbsEntry', MIN(T4.[AbsEntry]) AS 'SRNAbsEntry', MIN(T1.[WhsCode]) AS 'WhsCode', MIN(T1.[SL1Code]) AS 'SL1Code'
      , MIN(T1.[SL2Code]) AS 'SL2Code', MIN(T1.[SL3Code]) AS 'SL3Code', MIN(T1.[SL4Code]) AS 'SL4Code', MIN(T1.[SL1Abs]) AS 'SL1Abs'
      , MIN(T1.[SL2Abs]) AS 'SL2Abs', MIN(T1.[SL3Abs]) AS 'SL3Abs', MIN(T1.[SL4Abs]) AS 'SL4Abs'
      FROM  [dbo].[OIBQ] T0
      INNER  JOIN [dbo].[OBIN] T1  ON  T0.[BinAbs] = T1.[AbsEntry]  AND  T0.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBBQ] T2  ON  T0.[BinAbs] = T2.[BinAbs]  AND  T0.[ItemCode] = T2.[ItemCode]  AND  T2.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OSBQ] T3  ON  T0.[BinAbs] = T3.[BinAbs]  AND  T0.[ItemCode] = T3.[ItemCode]  AND  T3.[OnHandQty] <> 0
      LEFT OUTER  JOIN [dbo].[OBTN] T4  ON  T2.[SnBMDAbs] = T4.[AbsEntry]  AND  T2.[ItemCode] = T4.[ItemCode]
      LEFT OUTER  JOIN [dbo].[OSRN] T5  ON  T3.[SnBMDAbs] = T5.[AbsEntry]  AND  T3.[ItemCode] = T5.[ItemCode]
      WHERE T1.[AbsEntry] >= (0 )  AND  (T3.[AbsEntry] IS NOT NULL)
      GROUP BY T0.[BinAbs], T0.[ItemCode]
      ) T0
    WHERE T0.[IBQOnhandQty] > T0.[OnHandQty]
    Regards,
    JC.

  • CAML query to get itemcount from sharepoint list based on Month/Year

    Hi,
     I have a SharePoint list with date field. Now I wan't to get item count for each month in Fiscal Year using SP Services. Hence, need a CAML query to get item count . Any suggestions will be appreciated.
    Thanks in Advance.

    When you have your month, you'll need to calculate the first day and last day of the month and convert them to the ISO using to ISOString.
    startDate.toISOString();
    endDate.toISOString();
    function searchList(startDate, endDate) {
        var nURL = "/_vti_bin/lists.asmx";
        var soapEnv = "<?xml version=\"1.0\" encoding=\"utf-8\"?> \
                                 <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
                                  xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
                                  xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
                                  <soap:Body> \
                                  <GetListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">
                                  <listName>{YourList}</listName> \
                                  <viewFields></viewFields> \
                                  <query><Query><Where><And><Geq><FieldRef Name='DateField'
    /><Value Type='DateTime'>" + startDate +"</Value></Geq><Leq><FieldRef Name='DateField'><Value Type='Datetime'>"+endDate+"</Leq></And></Where></Query></query> \
                                  <queryOptions><QueryOptions><ViewAttributes Scope='Recursive'/></QueryOptions></queryOptions>
                                  </GetListItems> \
                                      </soap:Body> \
                                  </soap:Envelope>";
        $.ajax({
            url: nURL,
            beforeSend: function(xhr) {
                xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems");
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: processResults,
            contentType: "text/xml; charset=utf-8"
    function processResults(xData, status)
      var i;
       result = $(xData.responseText).find("z\\:row, row");
        if (result == undefined) {
            result = $(xData.responseXML).find("z\\:row, row");
        $(result).each(function(i, data) {
        //Magic   
          i++; 
        return i;
    Brandon James SharePoint Developer/Administrator

  • RQL Query to get the specific range of product items from product catalog.

    Hi All,
    I need to do the batch wise query to product catalog.
    For that i have use Query builder but that is giving me repeated items, now i wanted to use RQL using rqlStatement.
    Please help me in solving the issue.
    Query which i have used using QueryBuilder.
                    RepositoryView productView = productRepo.getView("product");          
                    QueryBuilder productBuilder = productView.getQueryBuilder();
                    Query productQuery = productBuilder.createUnconstrainedQuery();           
                    RepositoryItems[] productItems = productView.executeQuery(productQuery,startIndex,endIndex);
    Can anybody help me in writing RQL Query to get the specific range of product items from product catalog.

    Hi Shakuntala,
    There is no executeQuery method defined in RqlStatement Interface, which will accept index for output result.
    So As far as I know, what u are trying to achieve is not possible with RQL statements OOTB way.U can consider range of results based on some condition from Repository items.
    Please let me know if u find any way to implement it.
    Above Query builder should always return different ids if range is not overlapping with previous range.
    Please verify that repeated items ids are same or different,
    Quoting from API docs:
    RepositoryItem[] executeQuery(Query pQuery,
                                  int pStartingIndex,
                                  int pEndingIndex)
                                  throws RepositoryException
        Executes the given query and returns an array of matching RepositoryItems, which are contained within a total potential result set. For example used if one wanted to retrieve elements 50-60 from a query which could return 100 elements.
    Regards,
    Nitin.

  • CAML Query returning all items with date condition

    HI,
    I have a problem doing a query with CAML over the elements of a calendar in SharePoint 2013
    I just want to retrieve all items, which have been modified on a particular date. But below query returns all items from the Calendar.
    Any suggestion how to get specific items from the calendar. The same issue exists for start date  and end date.
      var oWebsite = clientContext.get_web();
        this.collList = oWebsite.get_lists();
        var camlQuery1 = new SP.CamlQuery();
       camlQuery1.set_viewXml(
       '<query><Where>'+
          '<Eq>'+
             '<FieldRef Name=\'Modified\'  IncludeTimeValue=\'TRUE\'/>' +
             '<Value Type=\'DateTime\'>2014-02-24T12:00:00Z</Value>'+
          '</Eq>'+
       '</Where></query>');
        this.collListItem1 = oList.getItems(camlQuery1);
        clientContext.load(collListItem1);

    Firstly try to make this change in your query and see if that helps
    camlQuery1.set_viewXml(
    '<View><Query><Where>'+
    '<Eq>'+
    '<FieldRef Name=\'Modified\' IncludeTimeValue=\'TRUE\'/>' +
    '<Value Type=\'DateTime\'>2014-02-24T12:00:00Z</Value>'+
    '</Eq>'+
    '</Where></Query></View>');
    Geetanjali Arora | My blogs |

  • Query to get Inventory ITEM details

    Hi All,
    Can any one give me the query to get the following details of an ITEM
    ITEM
    Description
    Onhand availability
    Org_id
    Item status
    Pricelist name
    Subinventory
    Revision
    Lot
    UOM
    Unit Price
    Thanks,
    Srikanth
    Edited by: 925743 on Apr 16, 2012 1:03 AM

    use the following query you will get max columns
    select segment1 as "ITEM",description,inventory_item_status_code,a.organization_id,list_price_per_unit,lot_control_code,primary_unit_of_measure,transaction_quantity,subinventory_code,revision,revision_qty_control_code from mtl_system_items_b a,
    mtl_onhand_quantities b
    Regards
    Raju

  • 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.

  • Camel Query : Calender list : Get Items agains given date that must be greater than and eqaul to start date and greater less than or equal to end date ?

    Camel Query : Calender list : Get Items agains given date that must be greater than and eqaul to start date and greater less than or equal to end date ?
    A Snap of Employee holiday list
    Case : Anne juul Sondergaar is on leave from 05-06-2014 to 07-06-2014
    I need a query to check wheither Anne juul is on leave at 06-06-2014 ????
    I am using this query that return nothing
    SPQueryquery =
    newSPQuery();
                                query.Query =
    @"<Where>
    <And>
    <And>
    <Leq>
    <FieldRef Name='Til' />
    <Value Type='DateTime'>"
    + WorkingStartDate.ToString("yyyy-MM-dd")
    + @"</Value>
    </Leq>
    <Geq>
    <FieldRef Name='Fra' />
    <Value Type='DateTime'>"
    + WorkingStartDate.ToString("yyyy-MM-dd")
    + @"</Value>
    </Geq>
    </And>
    <Eq>
    <FieldRef Name='Medarbejdere' />
    <Value Type='Lookup'>"
    + EmployeeName.Trim() +
    @"</Value>
    </Eq>
    </And>
    </Where>"
                                query.ViewFields =
    " <FieldRef Name='ID' />";
    Ahsan Ranjha

    Hello,
    Download CAML query builder from below location and use it to build your query:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/f7b36ebc-6142-404a-8b04-9c87de272871/where-can-i-download-the-u2u-caml-query-builder-for-sharepoint-2010may-i-know-the-exact-link?forum=sharepointgeneralprevious
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • How to view an epub file in digital editions in SINGLE PAGE CONTINOUS mode?

    how can i get the full screen real-estate when viewing an epub? On my laptop which has a screen res of 1600x900 i can maximize the view to one page at a time, but when i do the same thing on my desktop or dock to my 24" monitor of resolution 1920x108

  • Including a JSP page into a JSF page

    Hi !! I have read some posts here about <f:subwview>. There says to use: <f:subview>    <jsp:include page="somepage.jsp"/> </f:subview>But it does not work. How can i include a jsp page into a JSF page? Thanks !!!

  • Line In jack Problems

    Ok so here is my issue, The line in jack in the back of my imac, for a while it was working, i have a mic and a mixer for my recording studio, until the other day it worked, but when i pug it in everything runs really slow garage band freezes, and it

  • ENCRYPTION in Oracle Applications 11

    In Oracle applications 11.0.3, how is the security of data transferred between the client browser and the server maintained? Would tapping compromise the integrity of the data or is there any SSL or the like implemented? Thanks. null

  • How to manage language list in oracle bi logon page?

    Hello All! Can any one explain in detail, how "Select a Language" drop-down list is populated? How to exclude all but two languages from the list in BI 10g? It is well documented how to add languages, but this seems not to work in reverse. That is, d