With one of several rows with the same value for the same ID

Hello

I have this request:

SELECT

Count (case when EXISTS ())

SELECT *.

FROM business_log bl, su topic

WHERE su.ID_SUBJECT = s.ID_SUBJECT

and bl.id_subject = su.id_subject

AND bl.value = 'resolved '.

)

then 1 end another null) num_solved

OF THE subject

It is possible that a subject is more than once 'resolved' in the table BUSINESS_LOG

I want to count only one line solved for a topic.

I need to use only under RESERVE the table in the main query due to other counts.

Thank you very much.

Concerning

Milos

Post edited by: 2796614

in the examples before we talked abount 'Resolved' instead of 'resolved' as in your last example... to let you know, how it is stored.

I had advice is not to use SEPARATE.

So what... the evidence that any other question is faster than anything goes business_log, filter lines and can count distinct keys...

separate within a group function is not the same thing as do select distinct...

HTH

Tags: Database

Similar Questions

  • During the installation of the ultimate upgrade, get "one or several components of the system could not be configured", then it restarts and pours me to premium.___How can I say what is the cause of the problem and fix it?

    I have the same problem as Laweaver.
    I have a HP pavillion Model # m9040n running the 32-bit version with service pack 1.
    My Vista Ultimate Upgrade drive is 32 bit and also has Service Pack 1 on it.
    I ran my system through the Microsoft Update and it is common.
    I ran Vista Advisor and he tells me that everything is good to go.
    I also ran my system through the center of update of HP and he is current.
    I tried the Ultimate Upgrade three times and got the same message twice.
    Of course, it waits until it reaches "end of the upgrade" before it fails.
    I turned all the extra wide including the firewall when I tried the upgrades
    My computer came with the home edition Premium already installed on it and I have the disks of backup for him if I have to do a repair on it.
    I have the same question though - how to tell what the cause of the problem and fix?
    Thank you
    Rich

    Hi Eaglesoar1,

    This problem occurs because some features of Windows Vista cannot be migrated to the upgraded version of Windows Vista.

    To resolve this issue, follow these steps:

    1. click on Start, type programs and features in the search box, and then click programs and features in the list programs.
    2. under tasks, click on turn Windows features on or OFF.
    If you are prompted for an administrator password, type the password. If you are prompted to confirm, click continue.
    3. Click to clear the check boxes for the following features:
    o Microsoft .NET Framework 3.0\XPS Viewer
    O remote differential compression
    O DFS replication service window

    4 upgrade Windows Vista to a more advanced version and then click to select the check boxes that you clicked to clear in step 3.

    For more information see the Microsoft kb article below.
    Error message when you try to upgrade Windows Vista to a more advanced version of Windows Vista: "Windows cannot configure one or more system components to install Windows, restart the computer, and restart the installation.
    http://support.Microsoft.com/kb/946078

    I hope this helps!

    Halima S - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Insert several rows in the data table table

    Hi all

    I have a requirement as to insert multiple rows in the table for this table data only (I need to replicate the data).
    In this table, the primary key is a composite primary key with all the keys.primary foreign key and the foreign key to the Date. I need to change that date to the insertion.


    INSERT
    IN myschema. Fact_page_performance
    (
    time_sk,
    Batch_ID,
    delta_msec,
    delta_user_msec,
    error_code_sk,
    content_errs,
    element_count,
    page_bytes,
    Available,.
    date_sk

    )
    VALUES
    (SELECT time_sk,
    Batch_ID,
    delta_msec,
    delta_user_msec,
    error_code_sk,
    content_errs,
    element_count,
    page_bytes,
    Available
    OF myschema. FACT_PAGE_PERFORMANCE_BACKUP
    WHERE date_sk = 20090509, 20090510
    );

    But it gives error like missing expression.
    Could someone please help me.

    Thanks and greetings
    Swetha.

    You can have either the VALUES or not SELECT the two

    INSERT
    INTO myschema.Fact_page_performance
    (
    time_sk ,
    batch_id ,
    delta_msec ,
    delta_user_msec,
    error_code_sk ,
    content_errs ,
    element_count ,
    page_bytes ,
    Available ,
    date_sk
    
    )
    SELECT time_sk ,
    batch_id ,
    delta_msec ,
    delta_user_msec,
    error_code_sk ,
    content_errs ,
    element_count ,
    page_bytes ,
    Available
    FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
    WHERE date_sk=20090509,20090510;
    
  • by using a structure of the event to restore a Boolean control with change in value for the menu ring

    I'm trying to get two Boolean buttons to reset when the value of a ring menu.  For this I use a structure of event defined to execute with a ring value change.  However I have another code that should be run while the structure of the event expected to change value.  I place my structure of the event inside the while loop buttons reset as expected but my other code is not run (except when the value of change). If I place it outside the loop the rest of functions code as expected, but the buttons do not reset.  Any help you offer is much appreciated.

    Hello

    ADD TIME OUT EVEN AND GIVE DELAY OF 100 MS.

    Adds the case-application-timeout event

  • How to get several items when I select several rows in the DataGrid?

    Hi all

    I have a scenario where I have a datagrid and I have a few records in the datagrid control. I want to just select several lines of the data grid and display all the selected lines in datagrid, another... This as a multiple choice of datagrid... can someone tell me how I can achieve this scenario...?

    Thank you

    RAM

    Only, you should be able to use selectedItems.

  • Update of several rows of the same table using trigger

    Hello

    I have the following table

    ---------------------------------------------------------------------------------------------------------

    CREATE TABLE ATT_PERMISSIONS
    (
    DATE OF PRMONTHYR,
    EMPIDNUMBER (10)DEFAULT VALUE 0,
    FROMDATETIMEDATE,
    TODMTFDATETIMEDATE,
    NUMBER OF PERMMINS (3),

    SSLINASTRETCH NUMBER (3).

    PERMATTINELIGIBLENUMBER (1)DEFAULT VALUE 0
    );

    ------------------------------------------------------------------------------------------------------

    I want to update the column PERMATTINELIGIBLE in the same table when each line is inserted.

    I created following trigger for that

    CREATE OR REPLACE TRIGGER SSL_AFTER_UPDATE AFTER UPDATE ON ATT_PERMISSIONS

    FOR EACH LINE

    BEGIN

    Update ATT_PERMISSIONS set PERMATTINELIGIBLE =

    (

    SELECT THE CHECK BOX

    WHEN PERMMINS < = 60

    or

    (

    PERMMINS < = SSLINASTRETCH

    AND

    COUNT (CASE WHEN PERMMINS = 0 THEN NULL OTHERWISE 1 END)

    COURSES (PARTITION BY empid, prmonthyr) < = 1

    )

    THEN 1

    0 OTHERWISE

    END

    FROM ATT_PERMISSIONS where prmonthyr =:new.prmonthyr, empid =:new.empid

    ) where prmonthyr =:new.prmonthyr, empid =:new.empid;

    END;

    ---------------------------------------------------------------------------------------------------

    That is to say.

    When a row is inserted the PERMATTINELIGIBLE of all records for this employee for the month is recalculated.

    There would be only two or three records for an employee for a month.

    PERMMINS is the number of minutes to use as short leave.

    If it is less than 60 is eligible for the bonus to attendance for this employee.

    If this isn't normally the date is not eligible for the attendance for this employee premium.

    but an exception is that if a short leaves of DISP employee allowed a month (IE. ( SSLINASTRETCH ) in a straight line, IE. one day, that day is eligible for the bonus of presence.

    That is to say. Why the number of short leaves in a month is taken. If it's one and done minutes use is lower to SSLINASTRETCH, then the day is eligible for the attendance bonus.

    But when I try to create the trigger I get error, PL/SQL: ORA-00907: missing a right parenthesis.

    Help, please

    I use oracle 10g

    I want to update the column PERMATTINELIGIBLE in the same table, when each row is inserted.

    No - you do NOT want to do in a trigger.

    You cannot query the same table that the trigger is activated on. -C' is a MUTANT and you will get an exception.

    When a row is inserted is recalculated to the PERMATTINELIGIBLE of all the records for that employee for that month.

    There would be only two or three records for an employee for a month.

    PERMMINS is the number of minutes to use as short leave.

    If it is less than 60 is eligible for the bonus to attendance for this employee.

    If is not normally the day is not eligible for the premium of attendance for this employee.

    but an exception is that if a short leaves of DISP employee allowed a month (IE. SSLINASTRETCH) in a straight line, IE. one day, that day is eligible for the bonus of presence.

    That is to say. Why the number of short leaves in a month is taken. If it's one and done minutes use is less than SSLINASTRETCH, then the day is eligible for the bonus of presence.

    But when I try to create the trigger I get error, PL/SQL: ORA-00907: missing a right parenthesis.

    You can not do in a trigger. Even if correct you this error of syntax, you will get the exception that I mentioned above.

    Oracle is a multi-user system. Other users can modify the same table that you use.

    So even if you could try to interview "all the records for this employee" some of them may be locked if other users access them. Also, an insert statement could try to insert two rows for an employee and the trigger could not have seen the other lines still.

    If you want to work with data SETS (all records for an employee), you must write the PL/SQL code that LOCKS all lines updated to prevent others to interfere.

    Then you make your operations but NOT in a trigger. Perform inserts and then use an UPDATE query to set this value.

    Then VALIDATE to unlock the lines.

  • AppleScript find and pass variables with a single value for the new string

    Hello again,

    I need a solution to do this:

    We have the string

    {0, 0, '62 21 37', 1, 0, ' 62 21 37 ", 2, 0," 108 50 56 ", 3, 0," 167 102 95 ", 4, 0, ' 108 50 56", 5, 0, "145 84 83", 6, 0, "109 50 58", 7, 0, "109 50 58", 8, 0, "129 62 66", 9, 0, "120 56 62", 10, 0, "104 47 57" "" "" "" "" "} (a few example of result window)

    This is a Pixel data - x, y and RGB as a text

    How can we separate it into different channels organized by RGB, to create something like

    {'109 50 58', 6.0 7.0}

    {'62 21 37', 0,0,1,0}

    {"108 50 56", 2,0,4,0}

    and etc.

    Thank you

    Try using:

    the_string value {0, 0, '62 21 37', 1, 0, ' 62 21 37 ", 2, 0," 108 50 56 ", 3, 0," 167 102 95 ", 4, 0, ' 108 50 56", 5, 0, "145 84 83", 6, 0, "109 50 58", 7, 0, "109 50 58", 8, 0, "129 62 66", 9, 0, "120 56 62", 10, 0, "104 47 57" "" "" "" "" "}

    Set new_strings to {}

    Repeat with 3 to (count elements of the_string) by 3 this_item

    Set temp_list to {}

    If the element the the_string this_item is not in temp_list then temp_list temp_list this_item & point of the_string

    Repeat with this_list_item points of temp_list

    the value new_strings new_strings & (this_list_item as a list)

    end repeat

    Repeat with this_list from 1 to (account new_strings)

    If (this_list point new_strings as String) is point of the_string this_item then

    point Set this_list to {this_list point of new_strings} new_strings & elements (this_item - 1) at (this_item - 2) of the_string

    end if

    end repeat

    end repeat

    Repeat with 1 to (count elements of new_strings) this_list_1

    Repeat with this_list_2 (this_list_1 + 1) (count new_strings elements)

    If this_list_1 point new_strings is not {} and this_list_2 point new_strings is not {}, then

    If the item 1 of article this_list_1 of the new_strings is point 1 of article this_list_2 of the new_strings then

    point Set this_list_1 of new_strings to the point of new_strings this_list_1 & (items 2-3 (point get new_strings this_list_2))

    this_list_2 point new_strings value {}

    output of repetition

    end if

    end if

    end repeat

    end repeat

    Set result_string to {}

    Repeat with this_string in new_strings

    If this_string is not {}, and then assign result_string result_string & this_string

    end repeat

    (143290)

  • Number of rows in each partition is displayed with a NULL value for a table partitioned in user_tab_partitions. Why?

    I created a table and partitioned on the date of the entry and added a local partitioned index.

    Now, I use a query to extract "num_rows" of user_tab_partitions to know the number of rows in each partition.

    Getting this value as null num_rows, wonder why?

    After looking to explain the Plan after interrogation ("select * from my_table1 where entry_date = 1 January 2015" ;))

    to find out if she actually partitioned table and its data in different partitions, I interpreted in effect because the query plan had a line like Partition_range (Single).

    My Question is:

    (a) is actually partitioned data (have I misinterpreted the Explain plan)

    (b) why is the num_rows null column in the query (Pasted below)

    (c) also in addition what difference it would have been if I had created a Global Index instead of the Local Index in my case?

    The following code Snippet:

    ----------------------------------------------------------------------------------------------

    create the table my_table1
    (
    roll_no number constraint my_table1_pk primary key,
    date of entry_date
    )
    partition of range (entry_date)
    (
    PARTITION data_p1 VALUES LESS THAN (TO_DATE (December 31, 2014 ',' DD-MM-YYYY ""));
    PARTITION data_p2 VALUES LESS THAN (MAXVALUE)
    );


    create an index only my_table1_indx on my_table1 (entry_date) local;

    ----------------------------------------------------------------------------------------------

    I now insert two lines:
    insert into my_table1 values (1, to_date ('01-01-2015', ' dd-mm-yyyy'));
    insert into my_table1 values (2, to_date('01-02-2015','dd-mm-yyyy'));

    ----------------------------------------------------------------------------------------------

    These have been inserted successfully, now using the query below shows num_rows column as null. I don't know why?

    SELECT table_name, num_rows, high_value, nom_partition
    Of user_tab_partitions
    where table_name = 'MY_TABLE1 '.
    ORDER BY table_name, nom_partition;

    ----------------------------------------------------------------------------------------------


    (a) is actually partitioned data (have I misinterpreted the Explain plan)

    Yes, it is partitioned. You can query this particular partition SELECT * FROM my_table1 (data_p1) PARTITION to check that.

    (b) why is the num_rows null column in the query (Pasted below)

    As already mentioned that you have not collected statistics.

    (c) also in addition what difference it would have been if I had created a Global Index instead of the Local Index in my case?

    In fact, you have created two types of indexes without knowing (can be)! One is not partitioned (although this column is not partition key) and another is partitioned (LOCAL). They are MY_TABLE1_PK and MY_TABLE1_INDX. You can check that USER_INDEXES.

    You can read this article to get an early jump on the partitioning of decision. Partition: Partition decisions

  • Several panels reducible Spry with different default values for open - close

    Hello

    The site I'm trying have a page with (5) folding panels Spry. (4) are by default open, (1) is set by default closed.

    I'm trying to get (3) open and (2) closed. However, defining a second flaw of closed panels give a syntax error.

    Someone knows how to operate, if possible at all?

    Screen shot 2013-11-11 at 11.53.40 AM.pngScreen shot 2013-11-11 at 11.53.06 AM.png

    Remove the parenthesis after "CollapsiblePanel5". It should be like this:

    var CollapsiblePanel5 = new Spry.Widget.CollapsiblePanel ("CollapsiblePanel5", {contentIsOpen: false});

  • Merge data from several rows in the output row

    rollno

    name
    City
    1--
    -XYZ-
    --Pune

    Suppose that it is a table of student and I want to output such as,

    rollno name of city

    ------------------------------------

    1 xyz Pune

    How can I get it pls tell me.

    Hello

    Here's one way:

    SELECT MIN (rollno) AS rollno

    MIN (name) AS the name

    MIN (City) AS city

    The STUDENT

    ;

    This assumes that each column will have (at most) only 1 entry not NULL.

    If my assumption is wrong, then after a few examples of data (CREATE TABLE and INSERT statements) and the results desired from these data.  Explain how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

  • Cannot migrate VM between 5.5 ESXi versions: the version of the product to the destination host does not support one or several CPU features

    We receive an error message that I am trying to make sense. I understand very well the notion of compatibility, CPU, CPUID, masking and so on, after working on a competitor hypervisor. However, this error seems wrong (or needs better wording) based on my understanding:

    Here is the message:

    ----

    A general error occurred: the version of the product to the destination host does not support one or several features of the CPU currently use by the virtual machine.

    Characteristics of CPUID level 0 x 1 'ecx' register are indicated with a '1' bit: x00x:xxx0:xx0x:x 000: x 0 11xx:00: 00xx:11xx

    ----


    This happened during the migration between two hosts ESXi with the same physical processors - in this case, a Westmere X 5650.


    The source host is on ESXi build 2068190 (5.5). The destination host is on ESXi build 1474528.


    The bits it seems to complain are:


    DTES64

    Monitor/MWait

    Cx16

    PDCM

    The punch line seems to be: "the product version of the destination host. However, I have trouble believing that support for these features have been added to ESXi between the two versions. If it were, VMware has been certainly silent about.

    For what it's worth, explicitly set us the CPUID masks in our virtual machines (no, CVS is not an option for us at this time.) This is the mask:

    CPUID.1.EAX = "00000000000000100000011001010001".

    CPUID.1.ECX = "00000010100110001110001000111111".

    CPUID.1.EDX = "10001111111010111111101111111111".

    CPUID.80000001.ECX = "00000000000000000000000000000001.

    CPUID.80000001.EDX = "00101000000100000000100000000000".

    cpuid.d.EAX = "00000000000000000000000000000000".

    cpuid.d.ECX = "00000000000000000000000000000000".

    cpuid.d.EDX = "00000000000000000000000000000000".

    Note that the bits of the message complains (2, 3, 14, 15) * are * in fact forced to '1' in our mask of cpuid.1.ecx. That means (if I understand correctly), ESXi does not have the virtual machine unless the host processor supports the feature. And in our case, the virtual machine will start with happiness on nodes, with both versions. It will be not simply migrate between them.

    So, long story short, is this a bug of ESXi? The error message is misleading? I understand something?

    Thank you


    Matt

    To use the masks feature VM in this way, you must replace all the 1 to your masks with-'s:

    CPUID.1.EAX = "00000000000000-000000 - 00-0 - 000-

    CPUID.1.ECX = "000000-0-00--000---000-000---".

    CPUID.1.EDX = '-000 - 0-0 - 0-

    CPUID.80000001.ECX = "0000000000000000000000000000000 -"

    CPUID.80000001.EDX = "00-0-000000-00000000-00000000000.

    cpuid.d.EAX = "00000000000000000000000000000000".

    cpuid.d.ECX = "00000000000000000000000000000000".

    cpuid.d.EDX = "00000000000000000000000000000000".

    Zeros erases the features that are not available on your hosts Westmere, and dashes will leave the other one features.  The problem with those masks was forced to you certain features on who would have normally been off.

  • Can I download applications to one laptop, several others to another, and the rest to another.

    Using the creative cloud, I want to download some applications on one laptop, several others and the rest to another one, then download all the apps on my desktop under the safeguard. Can I do? If so, how? With the help of several programs of each, at the same time on different computers, but not the same program will be a kind of violation? (IE. Photoshop on laptop 1, Illustrator on laptop 2, fireworks on laptop 3).  Thank you for your time.

    No need to turn this into an academic discussion: you have two activations and that's all, which means that you can install any number of programs in any number of combinations on 2 machines and use them, but no more. Everything else is neithere legalyl nor technically possible. Read the EULA. If you need more activations, purchase another license.

    Mylenium

  • PSD to recreate a link with the layermask or layers in Indesign

    Hai,

    I wrote several scenarios to recreate a link to the pictures from one place to the other.

    but when you use a file .psd with more then 1 layer or layermasks

    and during the first connection with the PSD, with importoptions one or several layers of the .psd are disabled.

    restoring links automatically with a (java) script causes all the visible PSD layers in Indesign files

    I do not found all the properties of binding to reallocate after the reissue link

    example of the script so far:

    theDoc var = app.activeDocument;

    var low = "72 dpi";

    Top Var = "300 DPI";

    var theDoc.allGraphics = myImages;

    for (i = myImages.length - 1; i > = 0; i--) {}

    var myImage = myImages [i] .itemLink;

    var org_path = myImage.filePath;

    org_path = org_path.replace(low,high);

    var myNewName = org_path;

    var myNewLink = new queue (myNewName);

    if {(myNewLink.exists)

    myImage.relink (myNewLink);

    myImage.update ();

    }

    }

    there in the Indesign of DOM properties and methods to manipulate re-edit it according to the old link

    change only the linkpath. Not found so for.

    There is "link.properties", which is the index?

    var theDoc = app.activeDocument;
    var low ="72dpi";
    var high = "300dpi";
    var myImages = theDoc.allGraphics;
    
    for (var g = 0; g < myImages.length; g++) {
         myImages[g].graphicLayerOptions.updateLinkOption = UpdateLinkOptions.KEEP_OVERRIDES;
    }
    
    myImages = theDoc.allGraphics;
    
    for (i = myImages.length-1; i >= 0 ; i--) {
         var myImage = myImages[i].itemLink;
         var org_path = myImage.filePath;
         org_path = org_path.replace(low,high);
         var myNewName  = org_path;
         var myNewLink = new File (myNewName);
         if (myNewLink.exists) {
              myImage.relink (myNewLink);
              myImage.update();
         }
    }
    
  • Delete multiple rows in the table.

    How to remove several rows in the table at the same time?

    I have a table with 10 rows.

    I have a loop for delete lines 1, 3 and 6.

    It deletes the row 1 and 3 of the Index out of Bounds exception.

    I know why this is happening.

    I'm looking for a function or something to delete several lines at once?

    Thank you

    It must be a logic error.

    For each row, you delete, you should reduce the number of indexes.

    For example

    If you want to delete lines 1, 3 and 6 of a table that contains 6 rows

    Remove row1 as Table.Row [0].instanceManager.removeInstance ();    [now how many lines will become 5]

    Remove row3 as Table.Row [1].instanceManager.removeInstance ();     [Note that index is 1 because you have already deleted a record, and the index starts at 0.

    Remove row6 as Table.Row [3].instanceManager.removeinstance ();      [already two deleted record, so 6-2-1 = 3 is your index to remove]

    You understand the logic?

    Nith

  • Clip of MultiCam, but with audio from SEVERAL sources at the same time?

    I recorded a seminar using several audio and video sources. Audio sources include a wire tie, room microphone and read directly from a computer.

    I got all the raw materials imported into FCPX and created a multicam clip, and everything is synchronized perfectly.

    For the video, I know how to make the cut between my different cameras.

    But for audio, I would be able to play several audio channels at once - namely, lapel mic and the mic to the audience. How can I do this?

    I know I could put the multicam audio clip: setback (for example) then also drag the microphone to the audience for the game. But that means every time I make an edit, I have to make it through two sources and must be absolutely sure that they fall never out of sync.

    I guess I could drag the multicam clip in the timeline twice (one above the other, so two are playing simultaneously), with a video source set to none. But the same problem - I always have to be very careful with the changes, two parallel versions never move out of sync.

    Is there a better way to do it?

    There are also sometimes I can do some automation of the volume of the different channels... so everything what you are proposing, please keep this in mind.

    Thank you!

    In fact with a multicam clip you need not "stuff" to work with multiple audio. It has excellent support directly in the application.

    See Steve Martin explain this: https://www.youtube.com/watch?v=HE4FRDMJBS0

Maybe you are looking for

  • HTML5 and youtube

    Hi, after update 10 Safari, youtube stopped opening, because she needs to HTML5. Where can I download or is - it possible to make YouTube work with FLASH? Thank you

  • ehRecord.exe - is - this?

    Sometimes - it's happened twice so far - when I start my laptop it has a new icon in the system tray. When I mouse over it the ToolTip says "Look at me". When I just the click of a mouse button I get the dialogue options 'view', 'Missile launch' and

  • Citing Picture Editor returns/dev/shmem path. How to access this path?

    Hi guys! I invoke the picture from Qt/C++ code editor. Everything is OK, but when I get the path of the image returned by the image card, this path is "/ dev/shmem/IMG_XXXX.jpg". How can I access this way? QFile told me that the path does not exist a

  • Fabric of interconnection in the care of the CF NPIV Switch mode? If anyone can confirm?

    Hello I'm working on a scenario where a client will make Direct Attach Storage for a pair of UCS fabric of interconnections. It will also need to connect a device of backup based on the CF to the FI. So let's run the s FI mode Switch CF. There appare

  • Outgoing calls blackBerry smartphones

    Whenever I have pick a contact and you are trying to dial, a '+ 1' is added to the number, and it is impossible to connect.  Example... + 1919-786-4567...   It must be 919-786-4567. Can someone tell me how to solve my problem? Thank you