Double line with aggrigate function problem

I want to see in my DB duplicate rows
This query works fine

SELECT COUNT (*),
Description,
fk_patprot,
IsConfirmed,
actual_schdate, fk_visit
OF sch_events1
Description of GROUP BY, fk_patprot, isconfirmed, actual_schdate, fk_visit having count (*) > 1


But the thing is
I want to see the event_id between the result column, event_id is not null and unique
If I execute this query then output will be empty, said 0 selected lines.
SELECT event_id,
Count (*),
Description,
fk_patprot,
IsConfirmed,
actual_schdate,
fk_visit
OF sch_events1
GROUP BY description, event_id, fk_patprot, isconfirmed, actual_schdate, fk_visit
Having count (*) > 1


What is the alternative for this request? I want these column in a query.

EVENT_ID | DESCRIPTION | FK_PATPROT | ISCONFERMED | ACTUAL_SCHDATE
1. AA | BB | CC | DD
2. AA | BB | CC | DD
3. QQ | QQ | QQ | QQ
4. QQ | QQ | QQ | QQ
5. QQ | QQ | QQ | QQ

Thanks in advance

Published by: Navneet Singh on July 22, 2011 08:34

Hello

One way to solve this problem is to use the function SUMMARY, rather than the aggregate COUNT:

WITH     got_cnt          AS
(
     SELECT     event_id
     ,      description
     ,     fk_patprot
     ,     isconfirmed
     ,     actural_schdate
     ,     fk_visit
     ,     COUNT (*) OVER ( PARTITION BY   description
                     ,            fk_patprot
                     ,          isconfirmed
                     ,          actural_schdate
                     ,          fk_visit
                      )     AS cnt
     FROM     sch_events1
)
SELECT     *
FROM     got_cnt
WHERE     cnt     > 1
;

Most of the functions of aggregation (including COUNT) have analytical equivalents, which can produce the same results without causing the disintegration of all results in one line per group. The PARTITION BY clause from analytical functions corresponds to the GROUP BY clause in the aggregation queries.

Tags: Database

Similar Questions

  • How to draw and edit double lines with Adobe Illustrator?

    I need tot draw road maps. This should be easy with the pen tool, but my problem is that I can't find a way to draw a double line with this tool. I've seen a lot of models and fancy border styles. Some do not have the lines double or even quadruple, but the problem is that they have an offset from the vector line and the space between the two lines (the edges of the road) cannot be filled. Somewere I also found a few pens called "Double line 1.1' to ' Double line 1.6' but they also had an offset from the vector and I could chance not regardless of the size of the lines and the interval between them."

    I'm looking for is a way to draw two lines in parallel and have tot option fill out the space between the two with a color or even a model.

    The color and the size of the lines should be variable to distinguish between several types of road.

    Y at - it a game's existing pencils for this? It would be nice to be able to attract not only the roads, but also railways and rivers!

    I'm certainly not the first person who needs to do that?

    I use HAVE version 6

    Here is a picture. You can adjust the color of each stroke by selecting the line in the appearance Panel, and then change the color in the little box. Your best bet is to save the appearance as a graphic Style, so you can apply it to any line in the future. Not necessary for a brush and easier to change.

  • replace a single quote with the double quotes with the function replace

    I work with one apex page, which contains a text as a filter box. If I put a single quote and find then I get the error message saying that parse error.

    For this, I want to replace one single quotation mark with double quotes, so this should be perfect. and apex should show the result.

    A allow the query to the same which will replace the single quote with double quotes.

    Published by: Santhosh Kumar T 15 Sep 2008 05:13

    If it was confusing... Try the less confusion (according to you)! ...

    Select Replace ("ab" | ") "|' it," ',' "') twice;"

  • Problems with a function replace

    May of you guys please tell me what I'm doing wrong here. I have 3 sets of characters that word product that I need to replace mine before getting into the DB. Here are the characters.

    & mdash; Delete this dashboard with -

    & rsquo; Remove the apostrophe with '

    & ldquo; "Remove the left quotation mark with.

    & rdquo; "Remove this double quote with."

    My problem is that the replace() function only gets the first occurrence and replaces. Not all occurrences. How can I replace all occurrences? Here is my code.

    I thought about it. Missed me the parameter ALL.


    Form.test = replace (#form.test #, "-","-", "ALL");
    Form.test = replace (#form.test #, "'", "" "," ALL");
    Form.test = replace (#form.test #, "" "," "", "ALL");
    Form.test = replace (#form.test #, "" "," "", "ALL");

  • How can I disable the function where my mouse over the double line that then creates a pop-up window?

    When I hover over a word or an expression that has a double line below, a suggestion box comes with a link that takes me to a site that is in regards to the word or phrase that I flew over.

    Hello kayjay76, this looks like a problem caused by some sort of adware on your pc. Please go to firefox > addons > extensions and remove any suspicious entries (toolbars, the things that you have not installed intentionally, I don't know what purpose they serve, etc.). also, go to the windows control panel / programs and remove all toolbars or potentially unwanted software from there and run a full scan of your system with the security software you have in place and various other tools such as the free version of malwarebytes & adwcleaner.

    Remove a toolbar that has supported your Firefox or the homepage search
    Fix Firefox problems caused by malicious software

  • Aeromy computer has keywords with a double line under them, how can I get rid of them

    my computer has keywords with a double line under them, how can I get rid of them

    Hi Pete McDowell,.

    Glad to know that the problem is solved. Let us know if face you any problems with Windows in the future.

  • Kalonline-works until I get the anti-piracy icon so stop saying: there is a problem with the function of anti-hacking

    I play kalonline (RPG game), when to start the game it works up until I get the anti-piracy icon so stop saying: there is a problem with the function of anti-hacking. the program stops. I am the admin of it say kal computer run it in administrator mode and I did and I delete and reinstall the game. Solve the problem in win 7 by a right click and run as administrator, they wanted to work in win xp it all fits on how to solve this problem. These are the things, I was told to do to fix it.
    Hello

    It comes to KalOnline.

    Your error message can be corrected by following these steps:

    1. run KalOnline in Administrator Mode.

    2 uninstall KalOnline d_lete the entire Inixsoft folder, then reinstall the game.
    I did it and and it has not worked. then I was told that this was causing the problem

    Please check your computer system.

    This problem has occurred by a kind of problem of piracy.

    And if you have used a kind of memory-editing program, it could be happen too.

    So if your receipt similar to, then please remove it.
    I have none of these things on my computer. All I know is that people who have not updated windows xp can play the game and people who win 7 can play the game if they right click icon and run as administrator, that I still say side here but no way to prove it.

    Hello

    I suggest you to get in touch with the manufacturer of games and see if there are any other fix for this problem.

  • Having the problem with the function on SG300 Dhcp / 500?

    Having the problem with the function on SG300 Dhcp / 500? now I can use the dhcp server on the two model, but have a problem.

    My problem is when I create

    VLAN 1: 192.168.0.1/24 dhcp pool 192.168.0.10 - 250

    VLAN 10: 192.168.10.10 - 250 192.168.10.1/24 dhcp pool

    case 1

    I plug the pc to vlan 1 can I get ip 192.168.0.11. But when I change this pc to a new port in vlan 2 I always get the same ip address. why I can not get IP of vlan2.

    case 1

    I plug the pc to vlan 2 I can get ip 192.168.10.11. But when I change this pc to a new port in the vlan 1 I always get the same ip address. why I can not get IP of vlan1.

    but when I have access to the switch and remove the link after that that i will get correct IP.

    I think this is the bug of this firmware. Could you help this case.

    This is a known bug that is the setting of Cisco

    Sent by Cisco Support technique iPad App

  • Add a new line of text/function in a file html with JSFL

    , I want to add a line of text/function in an existing html file. I can read the file with FLfile.read() , and this is my code:


    var pathCom=fl.getDocumentDOM().pathURI(); //get complete path

    var pathWOFile=pathCom.substr(0,pathCom.lastIndexOf('/')); //get the path without file

    var readFile=FLfile.read(pathWOFile+'/index.html'); //read the html file

    alert
    (readFile);


    and the structure of my html file is:


    <html>
     
    <head>

      
    <script>
      
    //i want to add a new function on this line
      
    </script>

     
    </head>
     
    <body>
     
    </body>
    </html>


    I already know there is a function called FLfile.write() to add some text to the file, but the text still added to the last line of the structure. Now, I want to add a function of text to the line between the <script> tag, how I did that, sorry for my bad English and thanks for your reply

    If it is always static (that is, you know exactly the tag) you can treat it as alternative text. I suggest you add an id to the tag so there is no confusion as

    var writeFileContent = readFile.replace("", "")
    

    And then rewrite the entire file

  • Creating a TableView with a component, problem with my lines.

    I am trying to create a table in a pane. Each row in the table will have three columns. I found an example of code to create the table, but I'm getting additional lines that I don't want.

    I want only lines with 3 columns but I have extra lines, including the content of the last column see image.

    Is someone can you please tell me what is wrong with my code?

        private Pane createPane(String category) {
    
            VerticalFieldManager vfm = new VerticalFieldManager();
    
            vfm.add(new LabelField("Add Task:", Field.FOCUSABLE | LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH));
    
            // Initialize the model if it has not yet been loaded
            _tableModel = new SortedTableModel(StringComparator.getInstance(true), 2);
    
            // Populate the list
            for (int i = 0; i < 3; i++) {
    
                String col1 = i + " 1";
                String col2 = i + " 5";
                String col3 = i + " 3";
    
                _tableModel.addRow(new Object[]  {col1, col2, col3});
            }
    
            // Create and apply style
            RegionStyles style = new RegionStyles(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1), Border.STYLE_SOLID), null, null,
                null, RegionStyles.ALIGN_LEFT, RegionStyles.ALIGN_TOP);
    
            // Create the view and controller
            TableView tableView = new TableView(_tableModel);
            TableController tableController = new TableController(_tableModel, tableView);
    
            // Set the controller focus policy to highlight rows
            tableController.setFocusPolicy(TableController.ROW_FOCUS);
    
            // Set the behaviour of the controller when a table item is clicked
            tableController.setCommand(new CommandHandler()
            {
                /**
                 * @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
                 */
                public void execute(ReadOnlyCommandMetadata metadata, Object context)
                {
                    Dialog.alert("Command Executed");
                }
    
            }, null, null);
    
            tableView.setController(tableController);
    
            // Create a DataTemplate that suppresses the third column
            DataTemplate dataTemplate = new DataTemplate(tableView, 1, 3)
            {
                /**
                 * @see DataTemplate#getDataFields(int)
                 */
                public Field[] getDataFields(int modelRowIndex)
                {
                    Object[] data = (Object[]) ((TableModel) getView().getModel()).getRow(modelRowIndex);
    
                    Field[] fields = new Field[3];
                    fields[0] = new LabelField(data[0], Field.FOCUSABLE);
                    fields[1] = new LabelField(data[1], Field.FOCUSABLE | DrawStyle.HCENTER);
                    fields[2] = new LabelField(data[2], Field.FOCUSABLE);
    
                    return fields;
                }
            };
    
            // Set up regions
            dataTemplate.createRegion(new XYRect(0, 0, 1, 1), style);
            dataTemplate.createRegion(new XYRect(1, 0, 1, 1), style);
            dataTemplate.createRegion(new XYRect(2, 0, 1, 1), style);
    
            // Specify the size of each column by percentage, and the height of a row
            dataTemplate.setColumnProperties(0, new TemplateColumnProperties(15, TemplateColumnProperties.PERCENTAGE_WIDTH));
            dataTemplate.setColumnProperties(1, new TemplateColumnProperties(15, TemplateColumnProperties.PERCENTAGE_WIDTH));
            dataTemplate.setColumnProperties(2, new TemplateColumnProperties(70, TemplateColumnProperties.PERCENTAGE_WIDTH));
            dataTemplate.setRowProperties(0, new TemplateRowProperties(ROW_HEIGHT));
    
            // Apply the template to the view
            tableView.setDataTemplate(dataTemplate);
            dataTemplate.useFixedHeight(true);
    
            vfm.add(tableView);
    
            // Pane's title
            LabelField iconTextLabelField = new LabelField(category, Field.FOCUSABLE | Field.FIELD_HCENTER);
            return (new Pane(iconTextLabelField, vfm));
        }
    

    Thanks in advance.

     _tableModel = new SortedTableModel(StringComparator.getInstance(true), 2); <-- "2" sorts it by the object at index 2, which is your "col3". The extra rows you see are like headers for the sorting. I think you should use a different Table Model.
    
            // Populate the list
            for (int i = 0; i < 3; i++) {
    
                String col1 = i + " 1";
                String col2 = i + " 5";
                String col3 = i + " 3";
    
                _tableModel.addRow(new Object[]  {col1, col2, col3});
            }
    
  • Having a problem to draw lines with arrows

    Hello

    Maybe it's a bug/clitch side Illustrator and possibly without my knowledge.

    Every time I have to draw a line and put a race with arrowheads - everything works as it should.

    When I want to preset stroke and the tips of arrows and to draw the line with them – applies only the race but spikes are not applied, when I check options of race that I see other options that I set myself, but for arrowheads unset/no applied as they appear.

    I really need to shoot a lot of lines of the arrow and it would be too much of a hassle to manually set the arrowheads to each line.

    Hope you can help.

    Best regards

    Alari

    Alari,

    You can turn off between the appearance of maintaining Art new and new Art has basic appearance to this button in the appearance palette.

  • How to make the double line things go away when I read web pages, that what happens in front of him just some words that are double line under the word and then you will see an announcement when the cursor passes through the word.

    He double blue line under a word like POWER or Medicare, etc.

    It is contextual advertising. You should be able to eliminate one of the following. I suggest you have a file hosts and Adblock Plus with EasyList filter subscription.

    Extension "Adblock more."

    You also need the filters as "Easylist" subscription so after installation of
    with the right button on the icon of the status bar and choose 'Préférences'
    then on the filters menu-> Add-> EasyList subscription
    https://addons.mozilla.org/firefox/addon/adblock-plus/ (608,3 KB)

    Blocking unwanted Parasites with a Hosts file

    Blocking is at the level of the system
    http://www.MVPs.org/winhelp2002/hosts.htm
    View/use the HOSTS offered above as a plain text file
    http://www.mvps.org/winhelp2002/hosts.txt (596KO)
    If you add one of your own you will have to keep in mind
      and manually include the online hosts.txt file below your own.
    

    Hosts file is more oriented to protect your system against the really bad
    or things spread by its host name. Do not confuse with no antivirus protection more.

    Please mark "resolved" a response that will better help others with a similar problem - hope it was her.

    BLOCKED TOO - with Adblock Plus - no problem:

    With the ease of blocking items in Adblock Plus occasionally, you can be too aggressive and suddenly disappear all over the page. Adblock Plus provides functionality to help you know more precisely what you block with on a page.

    As seen in the Preferences ("Ctrl + Shift + F"), ABP maintains separate groups
    -The filters that you created yourself (rules of Exception, blocking rules, element hiding rules)
    -Separate groups for each subscription filter

    The report of blockable items ("Ctrl + Shift + V"), it's where you go to see what is blockable, what is blocked and if blocked what the rule is on the line with the mouse hovering. It would also enable the source, so you can see if it was your rule. The right mouse button opens a context menu with options. I show the columns are {address, filter, type, State} selected to the right of the headings. I have sort by State so block appear in red at the top.

    You can use the report to make the changes you need.
    We'll see changes you make in the preferences.

  • How can I play files CSV lines with a different number of columns?

    Hi all

    I am trying to load CSV with DIAdem 2014 files, and I found there is a great tool, "use".

    However, with the CSV use tool, there are critical problem with my data files. (See photo)

    As you can see the CSV file attached, it includes a lot of lines with different columns.

    And here, use read the number of columns of 1st line (e.g.: 4 columns) and set it as the number of columns to read.

    So I can not load all of the data (e.g.: 53 columns) if first row data were lower than columns.

    Can anyone recommend any approach, please?

    Kind regards

    Young

    Admin 24/03/16 Note: files deleted by request of the user

    I just add a few lines of script and fix the related use. (I just added the code to get a direct look).

    The uri of the file will appear as a new kind of load in the dialog file tiara is intalled by double click

    Would be nice if you could provide some information, how the data was created. Maybe we can it add as official of our web page to use plugin.

    Option Explicit

    Void ReadStore (File)

    File.Formatter.Delimiters = «»
    File.Formatter.LineFeeds = \n
    File.Formatter.DecimalPoint = '. '.

    Dim startLine: startLine = file. GetNextLine()
    <>InStr (startLine, ' [Tenergy Bus Log Data] "" ") then
    call RaiseError()
    end if

    And that not File.Position = File.Size
    Dim groupName: groupName = file. GetNextStringValue (eString)
    If it isn't root. ChannelGroups.Exists (groupName) then
    root. ChannelGroups.Add (groupName)
    end if
    Dim grp: set grp = root. ChannelGroups (groupName)
    Dim i: i = 1
    do for real
    Dim val: val = file. GetNextStringValue (eR64)
    If isempty (val) then
    Exit
    end if
    < i="">
    dial the grp. Channels.Add ("Brand" & I, eR64)
    end if
    protected chObj: set chObj = grp. Channels (i)
    chObj.Values (chObj.Size + 1) = val
    i = i + 1
    loop
    Call File.SkipLine)
    Wend

    End Sub

  • DATACOPY function problem using several variables quick

    Hello

    I have problem when I use more variables and then a quick calculation with DATACOPY function. When I put a prompt variable in function DATACOPY it works but when I add one or more it gives me error Essbasse (I can see it in the Essbase Administration journal not in the syntax checking process):

    Not valid [Calc Script syntax

    DATACOPY Q1020-> Dec-> 'FY14'-]

    [Fri Jul 11 15:04:25 2014] Local/TS_PLAN/Prihodi/admin@Native Directory/1004/Error (1200421)

    Error occurred at or after the line [8]

    -Essbase put FY14 because it is rapidly Variable in this error above.

    I try datacopy function with this:

    DATACOPY Q1020-> Dec-> "FY14 '... It works

    DATACOPY Q1200-> Dec-> {YearPrompt}... It works

    DATACOPY Q1200-> Dec-> {YearPrompt}-> {ScenarioPrompt} it doesn't it break on variable ScenarioPrompt.

    Thank you

    Finally, I solved my problem. That was the problem Essbasse how to understand the spaces between the dimensions. I didn't not use quotes for members and I put space between the arrows. It gave me an error I think because he did not understand space as the space. Now, when I use quotes and remove the space between the arrows cross dimensions it works.

  • 10g of functional problems upgrade to 11g

    Hello gurus,

    Upgrading an instance 11i, between 10 and 11g db. Can you help us with the list of common functional issues that business users would face, as linked to workflows, customizations, localozations etc... If anyone has the list of common problems to wait with their resolution, it would be very useful.

    Modules of Oracle - PO, OM, INV, WIP, BOM, PRJ, AP, AR, GL, FA, mobile Service, EAM, iProc, iExp, CPSA

    Thank you.

    A database upgrade is technical and it usually causes no functional problems. However, you may consult the following and see if they help.

    R12.1:invalid objects after 11 GR 2 Db and Ebs 12.1.3 Upgrade [1342701.1 ID]

    ORA-29532 after upgrade of database environment APPS [833237.1 ID]

    Autoinvoice does not process the records in the Table of Interface [ID 1513105.1]

    Registry of unused and unresolved recipes fail with ORA-06502 [ID 1471891.1]

    AutoInvoice error: RAXTRX does not all lines when called via RAXMTR, but imports successfully when run as a standalone [1272820.1 ID]

    Slow performance in Pick release after upgrade to RDBMS 11.2.0.1 (GR 11, 2) [ID 1087099.1]

    Configurator does not not after upgrade to 11 g 2 [ID 1206697.1]

    Transaction and quick ship shipping forms will not compile after installing new release 12.1.2 [1103188.1 ID]

    Slow performance or FRM-40212 to Documents - additional rules [1369124.1 ID]

    After upgrading the database to GR 11 2 formula generation times out [1166703.1 ID]

    Thank you

    Hussein

Maybe you are looking for

  • Photos app cannot import iPhoto library

    My iPhoto library is quite large, 32 GB for 9 500 items.  I've recently updated my operating system and related applications, and when I use the Photo app to import the old iPhoto library, it shows 'Prepare the library' and starts the import process,

  • Unable to save the photos in the mail. Windows Live

    I have many emails in my Inbox that haven't attached photos photos are rather directly with the post office. So I am able to see the preview in the mail, but when I try to save the image it records the image with the named zip file: GETINLINE.aspx So

  • cannot update the drivers, cannot conect to the internet with them

    I have a dell laptop that I had to rebuild, it has Windows XP and the installation went great. my problems is that I need drivers for ethernet, network, multimedia controller and a PCI Modem. I can not find them on the internet with my other PC, all

  • N4032F error messages

    Hello Hope you can help me with these errors on a N4032F, these are the current settings: System model ID... N4032FType of machine... Dell network N4032Factive device backup following current assets---- ----------- ----------- -------------- --------

  • BIOS - administrator password

    Trying to boot into the bios administrator password appears then after three unsuccessful attempts system off code 50563289 need help HP 2000-2d19wm laptop Thank you