lines to the column and summation
Hi everyone, I am using oracle 10g consider the following data:
WITH the data as {}
SELECT 'XTR' mntrid, ctid 'AAA', ' hi tech' description, code "SPRING", 123.23 amount OF double UNION ALL
SELECT 'XTR' mntrid, ctid 'AAA', ' hi tech' description, code "SPRING", 111.23 amount OF double UNION ALL
SELECT 'XTR' mntrid, ctid 'AAA', ' hi tech' description, code to 'PAY', 666.23 amount OF the dual UNION ALL
SELECT 'XTR' mntrid, ctid 'AAA', ' hi tech' description, code to 'PAY', 888.23 amount OF the double UNION
SELECT "XTR2' mntrid, ctid 'BBB', ' Hi tech2' description, code to 'PAY', 333.23 amount OF the dual UNION ALL
SELECT "XTR2' mntrid, ctid 'BBB', ' Hi tech2' description, code to 'PAY', 222.23 amount OF double UNION ALL
SELECT mntrid "XTR3", "CCC" ctid, ' hi tech 3 ' description, code 'PC', 777.23 amount OF double
}
I would like secret lines at column and add the amounts. my output should be like this
MNTRID CTID DESCRIPTION MAIN PC PAYROLL
XTR AAA hi tech 234,46 1554.46
XTR2 BBB Hi tech2 555.46
CCC XTR3 Hi Tech 3 777.23
what I do is converting lines to the column and the display of the sum. for example, for mntrid = XTR I get the sum of all MAIN lines and the lines all PAY and PC.
Since there is no line of PC for XTR I display null.
can someone help me write a query that displays the output in oracle 10g above?
Hello
elmasduro wrote:
It's great Frank. Thank you very much.
I have a request. What happens if I want to add total main grad, wages, the pc? How would I do that.
output
Total general AFFID CTID DESCRIPTION MAIN PAY PC
XTR AAA hi tech 234.46 1554,46 1788.92
XTR2 BBB Hi tech2 555,46 555.46
CCC XTR3 Hi Tech 3 777,23 777.23
It's just plain old garden-variety SUM:
SELECT Mntrid
ctid
Description
, SUM (CASE WHEN code = "MAIN" THEN rise END) AS main
, SUM (CASE code WHEN = "SALARY" THEN rise END) AS pay
, SUM (CASE WHEN code = 'PC', THEN rise END) AS pc
, The SUM of (amount) AS grand_total-* NEW *.
FROM the data
GROUP BY mntrid
ctid
Description
;
Tags: Database
Similar Questions
-
ContextMenu on the line of the Table and ContextMenu on a table column
jdev12.1.3
I am able to use < f: facet = 'contextMenu' name > with af:table right-click on a table row to display the menu.
I am also able to use < af:showPopupBehavior popupId = "p2" triggerType = "contextMenu" / > on af:column right-click on the column to display the menu.
But when I have both on, do a right click on a row and column do not work.
My question is: is it possible to have do a right-click on the column and right-click on the line on the same table?
Thank you.
I'm sorry. I meant the context menu on the text in the table cell.
I managed to make it work.
Here's what I did:
...
... ...
.....
...
-
I need to convert PDF to Excel, however, the columns and tabs make many merged cells and the number of columns empty. In addition to not separate the columns properly, I see many not separate lines together in the same cell. I even think that Adobe Acrobat Pro DC has limits. There is no way to set what points in columns to force the column break? Or create several columns that are unnecessary? How column in Excel, size fixed when import us text and define where breaks have columns of text?
Google Tradutor para empresas:Google para appsTradutor sitesGlobal market Finder traducao Toolkit
Acts traducao Instantaneasobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar comments
PDF does not contain columns, lines, formats, styles or other aspects of word processing or spreadsheet file formats.
This is because the PDF is decidedly not a file format of word processor or a spreadsheet or something 'like' one of these.
(see ISO 32000 for what PDF "is")
Which allows to optimize the export of the content of a page PDF is to start with that tag well formed PDF (ISO 14289-1, PDF/UA-1).
Without that export is what it is and we performs the cleanup of any necessary content using the native application for the export of files (MS Word or Excel).
Be well...
-
lines to the column for large number of files
my version of the database is 10 gr 2
I want to transfer the lines to the column... .i have seen examples of small no records, but how can it be done if there are more the 1,000 records in a table...?
Here is the example of data I'd like to change to column
SQL> / NE RAISED CLEARED RTTS_NO RING --------------- ------------------------------ ------------------------------ -------------- ----------------------------------------------------------------------------------- 10100000-1LU 22-FEB-2011 22:01:04/28-FEB-20 22-FEB-2011 22:12:27/28-FEB-20 SR-10/ ER-16/ CR-25/ CR-29/ CR-26/ RIDM-1/ NER5/ CR-31/ RiC600-1 11 01:25:22/ 11 02:40:06/ 10100000-2LU 01-FEB-2011 12:15:58/06-FEB-20 05-FEB-2011 10:05:48/06-FEB-20 RIMESH/ RiC342-1/ 101/10R#10/ RiC558-1/ RiC608-1 11 07:00:53/18-FEB-2011 22:04: 11 10:49:18/18-FEB-2011 22:15: 56/19-FEB-2011 10:36:12/19-FEB 17/19-FEB-2011 10:41:35/19-FEB -2011 11:03:13/19-FEB-2011 11: -2011 11:08:18/19-FEB-2011 11: 16:14/28-FEB-2011 01:25:22/ 21:35/28-FEB-2011 02:40:13/ 10100000-3LU 19-FEB-2011 20:18:31/22-FEB-20 19-FEB-2011 20:19:32/22-FEB-20 INR-1/ ISR-1 11 21:37:32/22-FEB-2011 22:01: 11 21:48:06/22-FEB-2011 22:12: 35/22-FEB-2011 22:20:03/28-FEB 05/22-FEB-2011 22:25:14/28-FEB -2011 01:25:23/ -2011 02:40:20/ 10100000/10MU 06-FEB-2011 07:00:23/19-FEB-20 06-FEB-2011 10:47:13/19-FEB-20 101/IR#10 11 11:01:50/19-FEB-2011 11:17: 11 11:07:33/19-FEB-2011 11:21: 58/28-FEB-2011 02:39:11/01-FEB 30/28-FEB-2011 04:10:56/05-FEB -2011 12:16:21/18-FEB-2011 22: -2011 10:06:10/18-FEB-2011 22: 03:27/ 13:50/ 10100000/11MU 01-FEB-2011 08:48:45/22-FEB-20 02-FEB-2011 13:15:17/22-FEB-20 1456129/ 101IR11 RIMESH 11 21:59:28/22-FEB-2011 22:21: 11 22:08:49/22-FEB-2011 22:24: 52/01-FEB-2011 08:35:46/ 27/01-FEB-2011 08:38:42/ 10100000/12MU 22-FEB-2011 21:35:34/22-FEB-20 22-FEB-2011 21:45:00/22-FEB-20 101IR12 KuSMW4-1 11 22:00:04/22-FEB-2011 22:21: 11 22:08:21/22-FEB-2011 22:22: 23/28-FEB-2011 02:39:53/ 26/28-FEB-2011 02:41:07/ 10100000/13MU 22-FEB-2011 21:35:54/22-FEB-20 22-FEB-2011 21:42:58/22-FEB-20 LD MESH 11 22:21:55/22-FEB-2011 22:00: 11 22:24:52/22-FEB-2011 22:10:
could you do something like that?
with t as (select '10100000-1LU' NE, '22-FEB-2011 22:01:04/28-FEB-2011 01:25:22/' raised , '22-FEB-2011 22:12:27/28-FEB-2011 02:40:06/' cleared from dual union select '10100000-2LU', '01-FEB-2011 12:15:58/06-FEB-2011 07:00:53/18-FEB-2011 22:04:56/19-FEB-2011 10:36:12/19-FEB-2011 11:03:13/19-FEB-2011 11:16:14/28-FEB-2011 01:25:22/', '05-FEB-2011 10:05:48/06-FEB-2011 10:49:18/18-FEB-2011 22:15:17/19-FEB-2011 10:41:35/19-FEB-2011 11:08:18/19-FEB-2011 11:21:35/28-FEB-2011 02:40:13/' from dual ) select * from( select NE, regexp_substr( raised,'[^/]+',1,1) raised, regexp_substr( cleared,'[^/]+',1,1) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,2) , regexp_substr( cleared,'[^/]+',1,2) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,3) , regexp_substr( cleared,'[^/]+',1,3) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,4) , regexp_substr( cleared,'[^/]+',1,4) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,5) , regexp_substr( cleared,'[^/]+',1,5) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,6) , regexp_substr( cleared,'[^/]+',1,6) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,7) , regexp_substr( cleared,'[^/]+',1,7) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,8) , regexp_substr( cleared,'[^/]+',1,8) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,9) , regexp_substr( cleared,'[^/]+',1,9) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,10) , regexp_substr( cleared,'[^/]+',1,10) cleared from t union select NE, regexp_substr( raised,'[^/]+',1,11) , regexp_substr( cleared,'[^/]+',1,11) cleared from t ) where nvl(raised,cleared) is not null order by ne
NE RAISED CLEARED 10100000-1LU 28-FEB-2011 01:25:22 28-FEB-2011 02:40:06 10100000-1LU 22-FEB-2011 22:01:04 22-FEB-2011 22:12:27 10100000-2LU 28-FEB-2011 01:25:22 28-FEB-2011 02:40:13 10100000-2LU 19-FEB-2011 10:36:12 19-FEB-2011 10:41:35 10100000-2LU 19-FEB-2011 11:03:13 19-FEB-2011 11:08:18 10100000-2LU 19-FEB-2011 11:16:14 19-FEB-2011 11:21:35 10100000-2LU 06-FEB-2011 07:00:53 06-FEB-2011 10:49:18 10100000-2LU 01-FEB-2011 12:15:58 05-FEB-2011 10:05:48 10100000-2LU 18-FEB-2011 22:04:56 18-FEB-2011 22:15:17
You should be able to do without all these unions using a connection by but I can't quite make it work
the following does not work, but perhaps someone can answer.select NE, regexp_substr( raised,'[^/]+',1,level) raised, regexp_substr( cleared,'[^/]+',1,level) cleared from t connect by prior NE = NE and regexp_substr( raised,'[^/]+',1,level) = prior regexp_substr( raised,'[^/]+',1,level + 1)
Published by: pollywog on March 29, 2011 09:38
Here it is with the type clause that gets rid of all unions.
WITH t AS (SELECT '10100000-1LU' NE, '22-FEB-2011 22:01:04/28-FEB-2011 01:25:22/' raised, '22-FEB-2011 22:12:27/28-FEB-2011 02:40:06/' cleared FROM DUAL UNION SELECT '10100000-2LU', '01-FEB-2011 12:15:58/06-FEB-2011 07:00:53/18-FEB-2011 22:04:56/19-FEB-2011 10:36:12/19-FEB-2011 11:03:13/19-FEB-2011 11:16:14/28-FEB-2011 01:25:22/', '05-FEB-2011 10:05:48/06-FEB-2011 10:49:18/18-FEB-2011 22:15:17/19-FEB-2011 10:41:35/19-FEB-2011 11:08:18/19-FEB-2011 11:21:35/28-FEB-2011 02:40:13/' FROM DUAL) SELECT * FROM (SELECT NE, raised, cleared FROM t MODEL RETURN UPDATED ROWS PARTITION BY (NE) DIMENSION BY (0 d) MEASURES (raised, cleared) RULES ITERATE (1000) UNTIL raised[ITERATION_NUMBER] IS NULL (raised [ITERATION_NUMBER + 1] = REGEXP_SUBSTR (raised[0], '[^/]+', 1, ITERATION_NUMBER + 1), cleared [ITERATION_NUMBER + 1] = REGEXP_SUBSTR (cleared[0], '[^/]+', 1, ITERATION_NUMBER + 1))) WHERE raised IS NOT NULL ORDER BY NE
Published by: pollywog on March 29, 2011 10:34
-
APEX do not allow to change the lines of the columns that are the primary key?
I have pictures:
http://img508.imageshack.us/my.php?image=21269582oe8.jpg
Book (id_book - 'Primary key', title, year); book_author (id_author id_book - 'Primary key', - 'Primary key'); author (id_author - "Primary key", name)
I created a new page-> Form-> form of 'author' table because I want to add new authors, modification and deletion. During the creation of this page, I have chosen column 'id_author' as '1 primary key column' and everything is OK (I can't edit the 'id_author' column - this column is autoincrement and I can change the 'name' column).
BUT I also created a new page-> Form-> table for table "book_author" because I like to write numbers like id_book and id_author, change and remove them (so add relations between tables: book, book_author and author). During the creation of this page, I have chosen column 'id_book' as '1 primary key column' and 'id_author' as 'column primary key 2'. And on the Web site, I can't edit these fields. And I can not add also new line because I see in each new line: (null).
http://img444.imageshack.us/my.php?image=11324615yk9.jpg
APEX do not allow to change the lines of the columns that are the primary key? It's stupid... What can I do?
Edited by: user10731158 2008-12-20 11:40Column unique and not meaningful if you ever want to update. In the case of your example, you need to add an ID column in the intersection of book_author table. Honestly, I was so blown away (and pleasantly surprised) by the absence of rebuttal and the "thx" I advanced and set up an example of how I would define the book_author table:
create table book_author (id varchar2(32), book_id varchar2(32), author_id varchar2(32), modified_on date, modified_by varchar2(255), constraint book_author_pk primary key (id), constraint book_auth_book_fk foreign key (book_id) references books(id), constraint book_auth_author_fk foreign key (author_id) references authors(id) ) / create unique index book_author_uq on book_author (book_id,author_id) / create or replace trigger biu_book_author before insert or update on book_author for each row begin if inserting then :new.id := sys_guid(); end if; modified_on := sysdate; modified_by := nvl(v('APP_USER'),user); end; /
Good luck
Tyler -
Qosmio G30 - white lines on the screen and BSOD
1. I have a Qosmio G30
2 operating system Windows XP MCE
and I have problem "white lines on the screen ' when windows start to load after that I got the"blue screen of death"and restart the computer.
I try to get back, but unfortunately came with the laptop recovery CD doesn't seem to work...Whenever I finished to recover I have "windows loading files" and once this is done, it shows me the so-called "blue screen of death"...
Hello
I m afraid. I have bad news for you ;(
I think you ve you have a problem with the hardware in my eyes, there might be something wrong with the GPU chip.
The white lines on the screen could be related to a faulty graphics card and get the BSOD error due to a hardware malfunction or software serious questionsI m sure that the recovery CD does not contain software problems and therefore only the fault of hardware could be the reason for the lines on the screen and the BSOD.
In my opinion, you should contact the ASP in your country for assistance if all goes well you guarantee is valid.
Good luck
-
I can only view my contacts by "online status" in windows live mail. I accidentally deleted all the columns and cannot see contacts, emails. How to bring back my columns?
Hi celine,.
For a more specialized on issue of Windows Live Mail help, post your query on the Windows Live Forum. Windows Live Forum - http://windowslivehelp.com/
-
Original title: Word 2003 Documents
I was working on a document I had previously recorded on my flash drive. All of a sudden the paragraph symbol appeared at the beginning of each line in the document and all documents on the flash drive. In addition, it appears on every document in the my documents folder.
Can anyone help?
Google search:
How do I turn off paragraph symbol in Word 2003
"You should have a paragraph symbol button in the bar... click on this tool and formatting symbols will disappear."
-
I have an epson printer p950 and try to print from lightroom. I get lines across the image and Epson tell me I need to contact you to find out how to slow printing
Suggest you to reset preferences in Lightroom and then, check out: to zero (or "Screw up") the preferences of Lightroom - Lightroom Forums file
-
Photoshop CC 2015 is a line connecting the start and end of the brush strokes
Hi guys,.
I had a strange problem with a certain brush (size 5px, difficult tour, no shape dynamics, no transfer) in Photoshop CC 2015.1.2.
It only happens when the drawing very fast on my Cintiq 22HD.
The problem is PS is a line connecting the start and end of the brush strokes. I don't hold in shift or whatever it is.
I use a PC with these specs:
Intel Core i7 - 4790 K 4.00 GHz
ASUS motherboard
NVIDIA GeForce GTX 970 (10.18.13.5354 driver version)
16 GB OF RAM
Cintiq 22HD
Win 10
Is it a question of PS or Cintiq?
Thanks for help.
OK, here is therefore an update.
The problem is not at all with Photoshop or Cintiq, with Windows 10 parameters of the stylus.
Fortunately, there is a small piece of free software that you can download called "Fix my pen" (by Smith Reddy) which defines the features of Windows Tablet PC in the registry for you (essentially by disabling everything related to it):
viziblr - News - difficulty my pen makes your Wacom tablet JUST WORK on Windows 7
It works fine on Win10 too.
Now, as my original problem with Photoshop to do a line connecting the start and end of the brush strokes left, however I have another question more small that came after running difficulty my pen. The lines that I draw now are not smoothed by a software more. You can see the difference below.
Fix My Pen sets a lot of things in the registry, but you cannot individually control which setting is disabled. So I guess that one of them is the cause.
I expect response from Smith about it, cause I have no idea who he is.
-
I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format. How can I get the pdf data into the columns and rows so that I can do the calculations?
If you start the https://forums.adobe.com/welcome Forums Index
You will be able to select a forum for the specific Adobe products you use
Click on the symbol "arrow down" on the right (where it is said to see all our products and Services) to open the drop-down list and scroll
-
How to query start a new line in the column?
How to query start a new line in the column?
Exam
SELECT ID, username | host name, details of xxx;
on the 2 column, I need result below:
Username ID | hostname in detail
1 user1 xxxxxx
host1
2 user2 xxxxxx
host2
Kind regards
SuradechSomething like that?
SQL> WITH tbl AS (SELECT 1 id,'user1' uname,'xxx' dtl,'host1' hname FROM DUAL UNION ALL 2 SELECT 2 id,'user2' uname,'yyy' dtl,'host2' hname FROM DUAL UNION ALL 3 SELECT 3 id,'user3' uname,'zzz' dtl,'host3' hname FROM DUAL 4 ) 5 SELECT id,uname||dtl||chr(10)||hname FROM tbl; ID UNAME||DTL||CH ---------- -------------- 1 user1xxx host1 2 user2yyy host2 3 user3zzz host3
-
line count (*) the amount and add it to the previous of the resulting column
Hello
I'm new to sql and I want to create an additional column which allows to calculate the value of a row in the column number with the rank of its predecessor on the column of the sum. This is the query. I tried to use CUMULATIVE, but it does not serve the purpose.
select to_char(register_date,'YYYY-MM') as "registered_in_month" ,count(*) as Total_count from CMSS.USERS_PROFILE a where a.pcms_db != '*' group by (to_char(register_date,'YYYY-MM')) order by to_char(register_date,'YYYY-MM')
That's what I
registered_in_month TOTAL_COUNT
-------------------------------------
2005-01 1
2005-02 3
2005-04 8
2005-06 4
But what I would like to show is less than
registered_in_month TOTAL_COUNT SUM
----------------------------------------------
2005-01 1 1
2005-02 3 4
2005-04 8 12
2005-06 4 16
Hello
So all the ranks of the exit, you want a total cumulative up to and including this line. It's just that the analytical SUM function.
Here's one way:
SELECT TO_CHAR (TRUNC (hiredate, 'MONTH')
, 'fmMonth, YYYY ".
) AS registered_in_month
COUNT (*) AS total_count
, SUM (COUNT (*)) ON (ORDER OF TRUNC (hiredate, 'MONTH'))
AS total_so_far
FROM scott.emp
WHERE job! = "ANALYST."
GROUP OF TRUNC (hiredate, 'MONTH')
ORDER BY TRUNC (hiredate, 'MONTH')
;
I don't have a copy of your table, so I used scott.emp to illustrate.
I like the GROUP BY TRUNC (dt, 'MONTH') instead of GROUP BY TO_CHAR (dt,...) because it allows me to display in any format and always sort in chronological order.
For example, the output of the above query is:
REGISTERED_IN_M TOTAL_COUNT TOTAL_SO_FAR
--------------- ----------- ------------
December, 1980 1 1
February, 1981 2 3
April, 1981 1 4
May, 1981 1 5
June, 1981 1 6
September, 1981 2 8
November, 1981 1 9
December, 1981 1 10
January, 1982 1 11
May, 1987 1 12
Of course, YYYY-MM format works, too.
-
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 filterThe 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. -
Update line in the column-based database
Hello
I am trying to find a way to update a row that has a SQL database based on two columns. If the command and the match number sensor order number and sales sensor that already exists in the database, I want to update the column of reading of the sensor. If not exists then I want that it creates a new line. How would I go to do this?
Thank you
Chris
You can use the tools of DB Query.vi Execute. Here is an example of a MS Access 2010 database where a column value is updated in all rows satisfying the WHERE conditions.
Ben64
Maybe you are looking for
-
A friend on FB said that if my URL box does not show as starting with https: (instead of http :) I am at risk of being hacked. I fixed it to FB, but all my other sites are coming as http:Is it really something to worry about?
-
HP Pavilion HPE h8-1205eo: should I buy a new wlan card?
I think that my Hp Pavilion HPE h8 - 1205eo:s wireless network card is broken. I can connect cable trought and everything, but he can't find any network without cable. I think I need a new card. I have a question before I go to things, might like wir
-
So today this app has started to request permissions on my phone. Never, he appeared on my phone before. Now Im not giving it all permissions. It is a system application. I want to ask you is this some kind of malware or part of the system? His reque
-
IRQL_NOT_LESS_OR_EQUAL (0X000000A)
Just, I formatted my HDD and reinstalled Windows. Initially, I had tons of problems for Windows Installer (very random BSOD), and after running Memtest86 on each stick of RAM, I found a wrong key. So, while I'm waiting for an RMA on that... I conti
-
Member of the main force in a pile of N2000
Hello I have a stack of switches N2000. For fair and easy management I want to force the master to a particular switch do not rely on higher MAC or other options in the manual. Is my question, possible to force a master member into a pile of N2000/N4