What is the equivalent of the Oracle of the FIRST of Microsoft Access function?

Use: Oracle 10 g 2 RAC on SUSE Linux 9 (10.2.0.3)

In the process of conversion of a Microsoft Access database to Oracle, an Access query uses the FIRST function.
What is the equivalent of the Oracle of the FIRST of Microsoft Access function?

In the conversion attempt, FIRST_VALUE Oracle has been used. However, the same results was not reached.
Thank you
(BLL)

Query:
H2. ACCESS:
SELECT
TRE. GCUSNO,
UCASE ([DCUSNO]) AS DCUSNO_STD,
* FIRST (UCASE ([DNAME])) AS DNAME_STD *.
* FIRST (UCASE ([DADDR])) AS DADDR_STD *.
* FIRST (UCASE ([DCITY])) AS DCITY_STD *.
TRE. DSTATE,
FIRST (TRE. DZIP) AS DZIP,.
TRE. DREGN,
TRE. DDIST,
TRE. DSLSMN,
TRE. DCHAIN,
TRE. MARKET,
TRE. MKTPGM,
TRE. EUMKT
Of
TRE
GROUP BY
TRE. GCUSNO,
UCASE ([DCUSNO]),
TRE. DSTATE,
TRE. DREGN,
TRE. DDIST,
TRE. DSLSMN,
TRE. DCHAIN,
TRE. MARKET,
TRE. MKTPGM,
TRE. EUMKT;



H2. ORACLE:
SELECT DISTINCT
TRE. GCUSNO,
SUPERIOR (TRIM (TRE. DCUSNO)) AS DCUSNO_STD,
SUPERIOR (TRIM (TRE. DNAME)) AS DNAME_STD,
SUPERIOR (TRIM (TRE. DADDR)) AS DADDR_STD,
FIRST_VALUE (UPPER (TRIM (TRE. (DNAME)) IGNORE NULL VALUES) (TRE ORDER. GCUSNO) AS DNAME_STD,.
FIRST_VALUE (UPPER (TRIM (TRE. (DADDR)) IGNORE NULL VALUES) (TRE ORDER. GCUSNO) AS DADDR_STD,.
FIRST_VALUE (UPPER (TRIM (TRE. (DCITY)) IGNORE NULL VALUES) (TRE ORDER. GCUSNO) AS DCITY_STD,.
TRE. DSTATE,
TRE. DZIP,
FIRST_VALUE (UPPER (TRIM (TRE. (DZIP)) IGNORE NULL VALUES) (TRE ORDER. DZIP ASC) AS DZIP,.
TRE. DREGN,
TRE. DDIST,
TRE. DSLSMN,
TRE. DCHAIN,
TRE. MARKET,
TRE. MKTPGM,
TRE. EUMKT
CRM. TREUP100R TRE
GROUP BY
TRE. GCUSNO,
SUPERIOR (TRIM (TRE. DCUSNO)),
TRE. DNAME,
TRE. DADDR,
TRE. DCITY,
TRE. DSTATE,
TRE. DZIP,
TRE. DREGN,
TRE. DDIST,
TRE. DSLSMN,
TRE. DCHAIN,
TRE. MARKET,
TRE. MKTPGM,
TRE. EUMKT;

A slight correction to the post of odie. I think you mean min max to replicate the primary function of access, but see below for sure. So:

min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std

user10860953 wrote: how it ignores null values?

The min and max functions automatically ignores nulls, so if there is a null value in tre.dname, it will not be returned, unless all values are null. For example:

SQL> WITH t AS (
  2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
  3     SELECT 37, 'DEFG' FROM dual UNION ALL
  4     SELECT 65, 'DEFG' FROM dual UNION ALL
  5     SELECT 65, null FROM dual UNION ALL
  6     SELECT 70, null FROM dual UNION ALL
  7     SELECT 70, null FROM dual UNION ALL
  8     SELECT 37, 'ABC' from dual)
  9  SELECT id,
 10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
 11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
 12  FROM t
 13  GROUP BY id;

        ID MIN_ MAX_
---------- ---- ----
        37 ABC  DEFG
        65 ABCD DEFG
        70

John

Tags: Database

Similar Questions

  • When you use find on the page (ctrl + F on Windows) it is a message indicating the total number of matches. What does the first number?

    When you use find on the page (ctrl + F on Windows) it is a message indicating the total number of matches. What does the first number?
    I'm more interested in the case when this number is smaller than the total.

    Hello

    I think you mean the text stating "x of there matches", to the right of the box where you entered the search term.

    The first number ("x" in my example above) indicates the current entry highlighted on the page that matches the search phrase. If you use the upper and down arrows to navigate through the instances of this term on the page, you will see this number go up and down.

    I hope this helps, but if not please come back here and we can look at another solution for you.

  • What is the first version of labview can be used with a USB-6001

    What is the first version of Labview, which can be used with a USB-6001?

    According to the user's Guide, you must DAQmx 9.9 or later version.  The oldest version of support DAQmx 9.9 is LabVIEW 2010 (DAQmx and LabVIEW version compatibility).

  • What is the commitment of microsoft in XBRL

    Original title: just a few opinion

    What is the commitment of microsoft in XBRL

    Hello

    Apparently, Microsoft is heavily involved in the XBRL standard. See the following link. This is old news.

    Microsoft Champions Standard for Reporting Financial Information: Q & A: Chief Accountant of the company discusses growing support for the Extensible Business Reporting Language (XBRL) standard as the solution to the need of "interactive data" when it comes to filing key financial data with government regulators. :
    http://www.Microsoft.com/presspass/features/2007/Feb07/02-09FinancialReporting.mspx

    Kind regards.

  • WHAT IS THE FIRST STEP TO ADDING TEXT TO YOUR NEW WEBSITE?

    WHAT IS THE FIRST STEP TO ADD TEXT/CONTENT OF MY NEW WEB SITE?

    @

    Create a new file of type HTML. (CTRL-N). Then type or paste the text.

    Images that you add to your new site must be included in the site folder. Then, you can drag and drop them.

  • I just purchased creative cloud. What is the first step I should take?

    I just purchased creative cloud. What is the first step I should take?

    I'm unable to download the apps and I don't know why. I thought it had something to do with me having the prior consent of the trial, so I advanced and deleted. And I can not even download applications. Am I missing a specific step in all of this? I was under the assumption that when I bought the creative cloud, it would be a kind of command prompt to install the program (the way adobe works normally) then I would be able to install applications separately.

    Hi Poe7,

    Welcome to the community & thank you for being the Member of creative cloud!

    The first thing is to download Creative cloud desktop application that will help you to download all the available applications, go to https://creative.adobe.com/products/creative-cloud and download it.

    One time downloaded, launch it and select any product to start the download/installation of the app.

    Thank you!

    Ankit

  • What is the difference between Microsoft Update and Windows update?

    My buton start brings up "Microsoft Update" and "Windows Update". What is the difference between the 2? If I click on do get updates for both?

    Hi jt3219,

    Yes, you will have updates for each of them when you click it.
  • What are the Common Files/Microsoft Shared/DOA?

    What are the "CommonFiles/MicrosoftShared/DOA?    And where can I find them?

    Hello

    1 could you please elaborate on the issue that you are facing?

    These files are associated with Microsoft Shared. This is the location of this file.

    c:\Program files\common files\ \daomicrosoft shared

    I hope this helps.

  • What is the URL of "Microsoft Genuine Diagnostics Tool"?

    I want to make sure that the copy of Windows installed on my computer is genuine.

    What is the Microsoft URL for 'true diagnostic Tool? "

    Same answer as above. It is not authentic.

  • What is the meaning of the OPA session tables in Siebel for OPA? That is to say why they were created when they should be used? and what was the first thought behind the creation of tables of session?

    Hi all

    I wanted to know best practices regarding the use of the tables of session OPA? that is, what was the initial logic of creating tables of session? where we should use them and why? also can you please argue for and against about two approaches mentioned below

    Method 1: Save and reterieve OPA session data tables using session ID and case ID?

    Approach 2: Save data in Siebel database tables and just use reterieve case Id Siebel data and save the back.

    Thanks for your replies.

    Session tables are there to allow easy storage of the results of an interview of the OPA. It can be used to extract data from an interview, but probably more useful as an archive of past interviews. Is it possible to load a previous interview in the determinations of the Web from this table.

    1. This can be very useful to resume a partially completed interview.

    2. it can be used as verification of de facto mechanism to see what has been entered in an interview.

    In general I prefer to approach 2 where there are intercepted the incoming data to an interview in a before handler registration and then save the data you need from the interview in the location that you must save it.

  • What is the right method to access the functions in a DLL compiled with a target of THIS (Arm)?

    I tried without success to access functions in a DLL that is meant for Windows CE.  My Labview application objective is a touchscreen the arm-based device.

    All, thank you very much for all your help.  I was still unable to find a method that did not produce an error when compiling... calls for a vi or a C file to be included.  (ex: [feature] is a missing file vi or C).  I also tried including the import library for the DLL, as shown above in the email from Paul, but I still received the same error.  This has been a problem for me, while testing with Win32 non-targets... in this case a device of THIS 5.0 touch screen based on the arm.

    However, I found a solution feasible and quite simple:

    Instead of trying to register the import library DLL as a file depending on the vi, I changed to build a DLL (and associated import lib) to build a static library (.lib) and included while .lib file as a dependent in the build specification.  This had the effect of linking statically, object code rather than wait for the vi compiler to compile the C source code or link a DLL import for a non-Win32 target library.  It is also not necessary to include an additional step in the installation of the DLL on the target device.  The library, I created is just a simple interface to another DLL already on the target device, which had struggled to interface directly to Labview.  Given that it is only a role of simple interface, this solution of library static woked well because it was not essential to have its available as a separately scalable DLL functions.

  • What is the difference between procedure and function?

    Hello
    I want to know the difference between procedure and function.
    Also, I want to know the types (if any) of procedures and functions.

    Concerning

    A function requires a return value.

    A procedure, while allowing the option PARAMETERS, mandates without return.

  • What is the latest version of Access Manager

    Nice day
    where can I download the last version of Access Manager, also if there is a patch for the latest version
    Very grateful

    The location that you are talking about a version 10g (10.1.4.0.1). The location I'm talking about has the latest version (10.1.4.3.0)

    Don't forget to join the latest version, you can install the latest version which is (10.1.4.3.0) and if you have an existing installation, you apply a hotfix that updates the existing installation to the latest version.

  • Unable to hear sound on the site of Microsoft Access 2007 training tutorial

    I can't hear the sound when you try to access this Microsoft Access 2007 training tutorial.

    I was able to play audio files and hear integrated audio from many other sites.  The problem seems to be related to this site.
    I am running:
    Service Pack 2 of Windows Vista Home Premium
    Realtek High Definition Audio
    Windows Media Player 11
    I checked...
    I checked the speaker and volume of the mixer is turned on.
    I checked for drivers updated - I have the latest
    I checked to make sure that the sound card is in working order
    Any suggestions?

    Problem solved.

    If I right click on the player embeded in the page.  Click on Zoom. Click on full screen I have no sound.
    I found that if I open Windows Media 11.x in the background the sound player immediately begins to play.
    Strange.
  • Is there a way to test for the first call of a function?

    Hello

    I created a function (using other functions I created) to generate a dynamic hierarchy tree menu based on parentID and itemID etc etc - I'm sure you are familiar with this concept. It works very well, and there is no problem.

    However, I do all this build in a string, and then dumped on the page. Again, this works very well. However, because the function is called recursively, my class, the class = 'tree' repeat itself in each occurrence of the opening UL tag.

    I want to only this class to be applied to the first UL, but because it is recursive, I don't know how to detect if the function is called for the first time or 5th time, etc.. I mean something like:

    < cfif myFunction is called the first time >
    Add the class
    < cfelse >
    do not add the class
    < / cfif >

    Please see my attached code. It is fully functional. Please don't worry that all the other functions do etc, they work very well, but I need a way or a variable to test against.

    Any ideas?

    Thank you very much
    Michael.

    Kapitaine wrote:
    > Hmmm, I bet that the solution is simple, but my mind is frazzled! Haha.
    >

    Yes, it's simple, you test the Boolean value and it will be true if it is
    set to true for a recursion.






    #somethingStupid(5,true) #.

Maybe you are looking for

  • I have a mac pro I will be able to use my hearing aid resign through it as my phone i 6 more

    will be my mac pro sport resound hearing aids

  • y510p 8.1 Windows black screen

    I tried to update my y510p to windows 8.1 twice now. But once installation is complete I get a black screen with a cursor. I tried to start in safe mode to install the right drivers, but it won't let me. It automaticaly boots and restore the previous

  • integrtae one table in other

    Hi guys,. I have an A array with length 10. All the elements are equal zero. Now I have a second table B with the length of 5 elements. Now, I have a third array with 5 items also. No I don't need to replace the elements has, whose indices are equal

  • 800b0100 error when you try to install the update KB968816

    Well, I get this error (800 b 0100) whenever I try to install the update KB968816. I have downloaded and run the system update tool. He has not fixed it. Is there a solution for this error?My plug for my laptop is: HP Pavilion DV5 1002nr3 GB memory23

  • E2 SD Acer liquid problem

    Hey guys,. I bought an Acer Liquid E2 Dual Sim version, and I have a question. Where is the mount SD option? Because the selected field is gray in the storage in Mount... 'untouchable '. What if I already have a SD card in? (a new). Does anyone have