The creation of some of the columns.

Hello

I would like to create 3 columns in my part of SQL

1 count of files to task_type = 'Reception' "assorted pallets.
2 sum of elapsed_time if task_type = 'Reception' "time (Mins).
3 account records to task_type = 'Réception' / sum of elapsed_time if task_type = 'Reception' X 60 'reception average (per hour).

All the info I need is a table called inventory_transaction.

Please could you show me how I should word my SQL when creating the separate as columns above muliptle.

Thanks in advance.

SM.

The column Code that animates your aggregate function in the query is missing. Also, you should post the result you expect from the sample data provided.

in any case, both Alex and Boneist have given you appropriate advice about the error you got. No point in repeating the same point again. ;)

Good luck!!!

Kind regards
JO

Tags: Database

Similar Questions

  • Some pages showing don't not the columns correctly since FF 37.0.1 update

    The problem showed up on a few pages on Lynda.com. IE 11 is not the problem.

    Here's a screenshot of a problem on Lynda.com in FF page, showing the column displays incorrectly:

    https://support.CDN.Mozilla.NET/media/uploads/images/2015-04-08-23-33-54-0d7e35.PNG

    And here is a screenshot of the same page in IE 11, is not displayed correctly:

    https://support.CDN.Mozilla.NET/media/uploads/images/2015-04-08-23-35-00-77f7ad.PNG

    Steps of troubleshooting so far:
    1 Refresh FF. No joy.
    2 disable all add-ons. No joy.
    3. run FF in safe mode. No joy.

    Nevermind, I fixed it. Changed some settings of Java, then changed their return.

  • Not Null on the column of a primary key constraint

    I came across a table defined in the same way to...

    create table t (t_id int constraint nn_t_id not null constraint pk_t primary, data key number);

    Of course, the primary key is the is not null, then is there a reason to add the redundant constraint not null?

    There are two parts to your question, I think:

    (1) why add a NOT NULL if a primary key is also reported.
    (2) why is null is NOT a name defined by the user (in this case nn_t_id).

    1 > I think you are right: there is no difference in behavior in the way that Oracle is going to reject the creation of NULL in this column (whether through the direct insert or update with a NULL value). I personally always declares the NOT NULL for columns, I know to never have null, regardless of whether the column is (member of) a PK.

    It's pretty funny, btw, the SQL standard as chosen able to be the NULL default value. I think that we all type much less, if the SQL standard chose NOT NULL default value. But that's another story.

    2 > I don't see given nullability defined by the user of the explicit names now and then, because of some "coding guideline' which dictates that constraint names must never be generated System. This guideline is often presented as a result of the exception handling of "client-side", where the constraint name is filtered SQLERRM and then more personalized to be displayed to the end user. However for NOT NULL constraint violations, I think (does not fully to check) that you are always thrown an ORA-01400 is an ORA-01407. Who nowadays both will tell you exactly (in SQLERRM) which column of this table is currently in violation of a NOT NULL constraint.

    Toon

  • Please tell us how to remove the 'message thread function' in the column 'Object' of my Inbox.

    Hello!
    For some reason, the column of the object on the Inbox of my e-mail account now has the topics of conversation. I have no idea how the son got there - and you would appreciate the help in eliminating these threads.
    Thanks a lot for your help.

    In the main menu bar:
    View (Alt - V) - sort by - Unthreaded

  • View of the column in the Finder

    OK, so I've had this problem before, but it sets out of himself, do not know how, but it just resurfaced again.  Normally, for the column, you can drag the width of the columns and make as wide or narrow as you want.  However, the mine at that time the bar doubled with the cursor instead of simple lines... and I can't adjust the columns...  Don't know what it is or how it goes.  Not sure if I am fairly clear in my description, but I add a page to help.

    Does anyone else have this and no idea how to change this?  I can't find anything in the Prefs or display Options or anywhere else.  I had to restart Finder in the Force Quit Applications window, so I don't know if that has anything to do with it.  Have also restarted my MBP as well.  I had posted a discussion about this before and can't remember if someone did or not, but I'm not.

    Thanks for your replies.

    Manfred Hi, I saw this behaviour a couple of times.

    Go to your 'Go' menu Finder, hold the option key and choose the library. Then go to the preferences and trash folder these files:

    com Apple.Finder.plist

    com Apple.sidebarlists.plist

    Then, restart or log in and again.

    (You will have to reset some finder prefs the way you like them).

  • Impossible to disable the column "Preview" in the Finder Windows

    Before that I describe this problem, I just want to clarify that I have configured Finder to always open folders in a new window, and while some of my files are put into mode icon that the majority is set to display in the list.

    Following an upgrade to Yosemite to El Capitan, some of my Finder list view windows began to show the column "Preview" on the side of the far right, after the date modified column. I don't like this feature because when none of the folders or items are selected it shows just a ugly "blank" space in the window. So, I quickly discovered that I can disable this "Preview" column by selecting "hide the Preview" in the view menu.

    The problem is that once I chose this, in many of my files change does not stick. After a reboot or a restart, I'll go back to the window and the preview column is again. Sometimes it happens immediately after closing the window and opening it again. The worst culprit is my user folder.

    I tried selecting "Hide Preview" and then enter the display options and set as the default view for all Finder Windows, but this makes no difference.

    Anyone know how to disable the overview at all times column in all the windows in the Finder?

    This is what it looks like in my folders set to display from the list:

  • A loop until the end of the column

    Hello!

    I have a string type 2D table that I want to loop through. The output of the table is feeding an "analysis of the string" vi and then converted into a timestamp. The problem is that the column of my table 2D is a different size. This means that some columns have a few empty cells towards the end of the column. When the cells are feed to the 'string analysis', and it occurs. I want it first is research in the table and delete all of the empty cells or find a way to the loop to the bottom of the column and stop when empty cells begin. The table is not fixed, then it is impossible to use a constant here. Can someone help me on this one?

    Greetings

    Kristoffer

    Here is my interpretation of the solution of Alexander.

    Right-click on the inner circle for loop to add the conditional terminal.

  • The column number of FreeCell

    Greetings!

    My Freecell game does not work as usual. Unfortunately, one of the columns form undearneath another. Therefore, one of the columns are left enpty and will accept the cards. I followed the instructions above I found in a fo the forums to remove and re-add the Freecell game. This, however, did not help my situation. I'm hoping to get detailed instructions.

    I thnak in advance for any and all help me with this situation fustrating!

    Hello

    Thank you for using the Microsoft Windows Vista Forums.

    Follow the instructions that might help you resolve the issue.

    I will need some additional information to help you best.

    Ø how do you remove and re-add the game?

    Method 1:

    Analysis of auditor of file system (CFS) that might help you resolve the issue.

    To determine if the problem you are experiencing is caused by one or more system files that are used by Windows Vista, run the System File Checker tool. The System File Checker tool analyzes the system files and replaces incorrect versions of system files by using the correct versions.

    To determine if the problem you are experiencing is caused by one or more system files that are used by Windows Vista, run the System File Checker tool. The System File Checker tool analyzes the system files and replaces incorrect versions of system files by using the correct versions.

    To run the System File Checker tool, follow these steps:

    1. Click Start and type cmd in the box start the search.

    2. right click on cmd in the list programs and then click Run as administrator.

    If you are prompted for an administrator password or a confirmation, type your password or click on continue

    3. at the command prompt, the following line, and then press ENTER:

    sfc/scannow

    When the analysis is complete, test to see if the problem you are experiencing is resolved. If the problem you are experiencing is not resolved, use the procedure that is described in the section "the System Restore tool.

    Follow the instructions in the link below for more information on scan SFC.

    http://support.Microsoft.com/kb/936212/

    Check whether the problem is resolved.

    Method 2:

    1. click the Start button, select Control Panel, click programs and then click turn on turn Windows features on or off.

    If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    2. to activate a Windows feature, select the check box next to the feature. To turn a Windows feature off, clear the check box.

    3. click on OK.

    Please post back and let us know if it helped to solve your problem.

    Kind regards

    KarthiK TP

  • Increase the length of the column - restriction key foreign vs MS SQL

    Hello

    I need to increase the length of the column (nvarchar) in some tables. Between these tables are foreign keys.

    When I try to do it on MS SQL databases using the command as "ALTER TABLE TABLE_NAME ALTER COLUMN column NAME NVARCHAR (50) NULL" then I get the error like below:

    Column ' dbo. TABLEA. NAME ' is not the same length or scale as the referencing column or the 'FKNAME' object depends on the column 'name'.

    Therefore resume, on MS SQL I drop all constraints, alter table and re-create constraints.

    When I do this same thing on the oracle database (oracle database a same pattern as MS SQL database, same fk, same tables, columns, etc.) using the command as "ALTER TABLE table_name MODIFY COLUMN NVARCHAR2 (40);  " then length is change without any erros and I wounder t - it a correct situation on oracle? -all the constraints are enabled. Oracle checks the length of data to foreign key columns?

    As I understand the error (ORA-02267: column type incompatible with the type of the referenced column) is the show that if the data type name is not equal between data tables not type length (?)

    To reproduce:

    1 create tables

    CREATE TABLE "TABLEA".

    (ACTIVATE THE 'NAME' NVARCHAR2 (20) NOT NULL,)

    NUMBER OF "TEXTID",.

    'PK_TABLEA' CONSTRAINT PRIMARY KEY ("NAME")

    );

    CREATE TABLE 'TABLEB.

    (SELECT 'ID' NUMBER NOT NULL,)

    NVARCHAR2 (10) "NAME."

    NUMBER OF "WWW."

    "TABLEB' ('ID') PRIMARY KEY CONSTRAINT

    );

    2. create the fk

    ALTER TABLE TABLEB ADD CONSTRAINT FK_TABLEB FOREIGN KEY ('NAME') REFERENCES 'TABLEA' ('NAME');

    On MS SQL, you get an error message on the same length of column ;) no

    Thank you

    Best regards

    Mateusz

    Whatever it is, the answer seems to be here: https://docs.oracle.com/cd/E17952_01/refman-5.5-en/create-table-foreign-keys.html

    "Corresponding columns in the foreign key and the referenced key must have similar data types. The size and the sign of the integer types must be the same. The length of the string types are not necessarily the same. For the non-binary (character) string, the character set and collation columns must be the same. "

  • Can someone tell me how to expand the columns of names of files in file Explorer?

    In each program, I've never used, all the user has to do to make a column more wide is to click on the divider bar at the top (or the side of the column) and drag the wider column. Instantly. Easily. Nearly second nature without looking.

    Now, clunky Windows 8 coming, and it's so frustrating!  I went on line and saw hundreds of people griping about the same and some of the answers are right-click on the column heading and click on the size, or to choose the longest title in your file and right click and choose the size of the car, but I don't have any of these options.  I right click on the longer title and don't get choices such as car size or size.  There is not a definable column header.  Above the list of files is a bunch of stuff in the Ribbon, none of this centered above the list of files.  Above, there are a few possibilities for right click produce the word "size" in the box that opens, but is not an active link, and I can't click on it.

    I'm amazed that I bought this "top of the new version of line everyone will go to" and it does not with ease.  It is not calculate how wide to make the column... computers are great to calculate.  Why not Windows 8?   When a program allows you to work harder, take four or five steps to do one thing, that is not good design. He should do it for us, we should not be on the right side of the mouse, click on the left side, etc.

    My main question is how to do widen the column, and my secondary question is how can we get Microsoft to listen to us?  I read the comment after comment on dozens of complaints, which is one of the most common.  Thus, besides wishing they would listen to us... I'll call their hotline tomorrow and complain... what someone knows in the meantime what can I do to see all the title of my files?  Right now they are all cut in half way through.  I want to enter this bar on the right and drag it to the right to reveal the name of file in the way of how work most computer programs.

    It almost seems as if Microsoft tried to make it more difficult for their base of users and new users.   It boggles the mind.

    Of course, I'd appreciate it if someone can tell me if it is still possible to make the column wider, and I would love it if there was a response that is easy without going through a lot of steps.  Thanks in advance to anyone out there who has thought about it!

    Happy new year!

    CG

    There is no difference in the way you make the columns wider if I understand the question.
     
    I guess you see something like this (without the arrows highlighting red and pointing to the column headings and separators that you hover over, click on + hold and drag to make greater/smaller in the method you describe):

    Or are you speaking of something else than the "File Explorer" you mentioned in your question?
     
    Also - if you get the "double-arrow" cursor hover at the same place as you would drag to the size of column wider or narrower and rather - double-click on - it (as it always has) calculates the necessary width to see everything in the column to the left of the separator you are clicking on and re - size accordingly.
     
    I think that the right click of the column header (see section highlighted above) and change the size to fit refers to this menu, you would get when right-clicking on the column headers highlighted in the picture above...

    Now there's something for everyone - you have to be in DETAILS view (as always) in order to get these beautiful columns.  "Very large icons', 'Large icons', 'medium-sized icons", "Small icons", "List", "Tiles" or "Content" views will not have columns to sort by...

    In addition, if you notice in the last frame, in the "Détails" view, you must, depending on the size of your window, see "All columns to fit the size" as an option in the view menu.
     
    And the "size of all columns to fit" as shown in the two methods I could think casual to show calculations for all columns and adjusts large/more details for all visible columns in the display of the Explorer of files in all areas.
     
    Oh - and in case you want to "Détails" view to be the default view from this moment for your windows 'Windows Explorer '... Change to it (as shown above) and find the 'Options' button in the top Ribbon (usually the one furthest to the right) and click on it (not the arrows on the side of it - click it to select it) and should open a new window called "Folder Options."  Select the 'view' tab and click on "apply to folders" and all other folders that you open from the moment which will 'View' by default (unless you change it.)  * Special note * here - you can be originally 'Computer' or 'My PC' Windows Explorer - display you must have at least one folder of the selected (such as "drive Local (c)") drive and active in order to see the button 'Apply to records' assets to click.
     
    New - this is essentially the same since Windows XP.  Some of the options have changed names (heck, even Windows Explorer is referred to as 'This PC' now instead of 'Computer' and 'My Computer') and there were a few additional views added and deleted - but even advanced stuff are quite similar to the latest methods to infer.
     
    Hope that helps.  Ask if you have any other questions and please come back anyway let everyone know if the response was satisfactory!

  • Chains of substitution in the column link attributes

    I use this attribute a lot recently to activate the link columns in reports to the pleasant appearance buttons, using the same set of classes used by the button model options, for example:

    class="t-Button  t-Button--warning t-Button--simple t-Button--stretch"
    

    Instead of use the chain, I would like to set it either by using a chain of substitution of application to create consistency, or the columns of the region to provide classes based on a condition of level line.

    link_attribs.png

    I spotted some differences in behavior between classic and IR and 5.0.1 and 5.0.2. I am not too concerned by version differences because the progress is there, but I want to ensure further progress.

    I have an example here, ws (swesley/otn/forum) connection details

    https://Apex.Oracle.com/pls/Apex/f?p=88776:3

    For both types of reports, the EMPNO uses & BTN_CSS. to supply the value of a string substitution of application. It works for the IR, but not for the classic. Instead, I see

    <a href="javascript:void(0);" &btn_css.="">7369</a>
    

    The ENAME field uses #LINK_ATTRIBS # the source of the value of the SQL. The caveat here is that the LINK_ATTRIBS column must escape special characters the value no. It works in 5.0.2 but not 5.0.1. The latter treats the string as if it has not been dropped?

    pasted_image_at_2015_11_03_09_22_pm.png

    My solution is to provide

    class="#LINK_ATTRIBS#"
    

    where the sql returns just the set of classes, not the full html tag.

    This problem has recently been described in the mou channel # _Suit.

    Hi Scott - thank you for viewing this issue, I am agree that traditional reports that should support the do of reports interactively. So, I advanced and implemented this change for APEX 5.1.

    Marc

  • all the columns in a database instance

    Hi all

    I need all these columns in the database for all tables to check some specific query ones. We have a table for the columns as we ALL_TABLES for all tables?

    Hello

    954475 wrote:

    Hi all

    I need all these columns in the database for all tables to check some specific query ones. We have a table for the columns as we ALL_TABLES for all tables?

    Yes, there is ALL_TAB_COLS.

    'ALL' in ALL_TAB_COLS, as in ALL_TABLES. You hear all those you have privileges to see, not necessarily those in the database.  The data dictionary views whose names begin with DBA_ (for example, DBA_TAB_COLS and DBA_TABLES) include all those in the entire database.  Usually, not everyone is allowed to use the DBA_ views.

  • retrieve the value column access via the variable name of the column

    I need to build a function of validation with this condition:

    The data model is like this:

    We have an array of items_general, with its id and data.

    Then we have specific tables, let's say... item_especific1, item_especific2 item_especificn. They have the same as the table of the item_general pk and fk against item_general

    Each element is in one of the tables item_specific and items_general.


    Now, the validation feature: I need to check for an element, if some special columns of the item_especificx table are null and will raise an error if this occurs.

    I got the name of especific_table and the list of names of particular column stored in another table.


    I guess I can browse this list of column table to build a clause concatening Dynamics 'and' | column_name | 'is nothing', but I'm not a big fan of the dynamic sql.


    Can you think of a better solution? Any way to access the value of the column by using the column name, as if it were a varchar2 key index?




    Nope, no filter.

    When you have a funky data like that model, you're destined to dynamic sql and other assortment of headaches.

  • Display of the data without knowing the columns.

    Hello

    I want to display data AS that OF EMP TABLE USING plsql.

    7499 "ALLEN SALESMAN" 7698 ' 20 / 02/1981 ' 1600, 300, 30

    Without knowing the column emp TABLE I want to display data.i have tried, but does NOT...

    DECLARE

    CURSOR c1 IS SELECT * from all_tab_columns WHERE table_naMe = 'EMP ';

    CURSOR c2 IS SELECT * FROM emp;

    v_column_name varchar (200);

    BEGIN

    I'm IN c1 LOOP

    FOR j IN LOOP c2

    v_column_name: = 'j' | i.column_name;

    dbms_output.put_line (v_column_name);

    END LOOP;

    END LOOP;

    END;

    Kind regards

    John

    Hi John,.

    Maybe this can help you:

    create or replace procedure prc_show_rows ( table_in varchar2 )
    is
      CURSOR c1 IS SELECT * FROM all_tab_columns WHERE table_name = upper (table_in);
      type table_output is table of varchar2(32000);  -- this can be a problem with large rows
      work table_output;
      v_statement varchar2(2000);
    BEGIN
      --
      v_statement := 'select ';
      --
      FOR j IN c1 LOOP
        v_statement := v_statement || j.column_name || ' || '' '' || ';  -- may be you need some more formatting with appropriate to_char clauses
      END LOOP;
      --
      v_statement := rtrim ( v_statement, ' |''') || ' from ' || table_in;
      --
      dbms_output.put_line ( v_statement ); -- not necessary, only for testing
      --
      execute immediate v_statement
         bulk collect INTO work;
      --
      for i in 1..work.COUNT loop
        dbms_output.put_line(work(i));
      end loop;
    END;
    /
    
    exec prc_show_rows ( 'emp');
    exec prc_show_rows ( 'dept');
    

    concerning
    Kay

  • A statement UPDATE changes the line if the update changes the column even value?

    HI -.

    I have a main classification and the corresponding audit table. I have a trigger. I created using the suggestion:http://www.runningoracle.com/product_info.php?products_id=211

    Now the problem that I am facing is that: if I run the same query (same value) update on the main table for n times (with the same data)... my audit table is updated with a new record every time. He is not able to determine that the value is the same.

    My goal is to load the audit table data if the value in a cell in the main table is really have changed.

    A statement UPDATE changes the line if the update changes the column even value?

    Best regards

    I have a main Table and the corresponding Audit Table. I have a trigger. I created using the suggestion:http://www.runningoracle.com/product_info.php?products_id=211

    Why?

    You try to resolve what made you what are the PROBLEM that select as the solution?

    Now the problem that I am facing is that: if I run the same query (same value) update on the main table for n times (with the same data)... my audit table is updated with a new record every time.

    Yes - it is EXACTLY what you say that you wanted to do and EXACTLY what the code does in this article.

    He is not able to determine that the value is the same.

    I think you mean that the code does NOT check if the value is the same. You can certainly change the code to do this check. But I have a question to start with your need for such a solution.

    My goal is to load the audit table data if the value in a cell in the main table is really have changed.

    OK - then modify the code to check EACH COLUMN and compare its NEW value to the OLD value and insert only the table of audit if SOME (or columns you care specifically) have changed.

    A statement UPDATE changes the line if the update changes the column even value?

    It depends on what you mean by 'change the line '. Of course to update a column with the SAME value does not change the resulting data value.

    But the physical structure of the line, the location of the pieces of line and information in the header block (YVERT, etc.) will change. And, as others have said Oracle doesn't know and doesn't care, so if the new value of a column is the same as the old value will create redo, undo and the rest.

    Start over and tell us what PROBLEM you're trying to solve. Then we can help you find the best way to solve it.

Maybe you are looking for

  • XP laptop with 1 GB of ram

    I have a Dell laptop with 1 GB of ram under XP. I get a message that it doesn't have enough memory. How can I fix or solve this problem?

  • XP Professional

    Windows xp professional operating systems, Windows Security Center says "Virus Protection is OFF", M/S Security Essentials says its aid "WE and Uptodate" Please

  • Remove the address headers in the window Live Hotmail

    How can I remove the address on headers in Windows Live Hotmail when you try to forward the message to all addresses?Pls Adv.Thanx.

  • BigBrother remote tests going all purple

    In our company, we have a windows 2000 Server to all our remote sites, these servers run the BigBrother (v4.40) client and report on a Linux server. Recently, we have moved to a new domain and after moving servers have had all their purple remote tes

  • trying to turn on the HTML editing in Internet Explorer 8

    Tools > Internet Options > menu allows you to select a particular editor for HTML editing. My question is how do I enable or disable the functionality of HTML editing in Internet Explorer 8