Select the statement and the Group of
Hi all
I have this code to display the total number of orders by customer id:
Select customer_id, sum (order_total) total
of demo_orders
Customer_id group;
and it gives me this result:
CUSTOMER_ID TOTAL
----------- ----------
1 2380
2 2370
3 2420
4 1060
5 1090
6 950
7 2760
7 selected lines.
But instead of the ID, I want to display their names, like this:
CUSTOMER TOTAL
Brown, John 3450
... and so on
How do I do that?
I know I can't include these columns concatenated in the selection list, because I would have to be included in the GROUP BY clause...
Thank you.
I know I can't include these columns concatenated in the selection list, because I would have to include it in the
Huh? Why not you. Have you actually tried it?
Just do what you say - include names concatenated in the select group of clauses.
Or you can just join the query you have each other to get the names, since we have no idea where the names are still stored. If they are in the same table as the ID then just use the solution "you know you can't do '!
Tags: Database
Similar Questions
-
I can't select the groups in my outlook account
under the head of the people, next to the used button it have a drop-down menu to select groups. but I'm unable to find these days.
Hey Monty,
Are you referring to Microsoft Outlook or Outlook.com?
If you use Microsoft Office Outlook, then I suggest you according to the query in Microsoft Office Forum for better support.
Reference:
http://answers.Microsoft.com/en-us/Office/Forum/Outlook
If you are referring to Outlook.com, then send the application in the Windows Live Forum for assistance:.
Reference:
http://answers.Microsoft.com/en-us/windowslive/Forum/mail
I hope this helps. If you have any other queries/issues related to Windows, write us and we will be happy to help you further.
-
How to select the group header with detailed data in a SQL
Dear Sir
I wish I had a little help from you. My goal is to create a view where the data should be in the appropriate format. In this format, I want to have for each header of a group.
I have 3 tables that they ar connected to the other (representing hierarchical data where financial plan breaks in different groups).
CRM_PLAN
CRM_PLAN_ID
DATE
AMOUNT
CRM_PLAN_PE
CRM_PLAN_PE_ID
TITLE
AMOUNT
CRM_PLAN_ID (REF CRM_PLAN key. CRM_PLAN_ID)
CRM_PLAN_MONTH
CRM_PLAN_MONTH_ID
YEAR
MONTH
AMOUNT
CRM_PLAN_PE_ID (foreign key to CRM_PLAN_PE. CRM_PLAN_PE_ID)
Data looks like:
CRM_PLAN
CRM_PLAN_ID | DATE | AMOUNT
1. 01.01.2012. 500
2. 01.02.2012 | 200
CRM_PLAN_PE
CRM_PLAN_PE_ID | TITLE | AMOUNT | CRM_PLAN_ID
1. Organization 1. 100. 1
2. Organization 2. 400. 1
5: 3 organization | 200 | 2
CRM_PLAN_MONTH
CRM_PLAN_MONTH_ID | YEAR | MONTH | AMOUNT | CRM_PLAN_PE_ID
1. 2012 | 1. 60. 1
2. 2012 | 2. 40. 1
5: 2012 | 1. 350. 2
4. 2012 | 2. 50. 2
3: 2012 | 1. 200 | 3
I would like to than the view that returns data as:
MONTH | AMOUNT
Organization 1. null
1. 60
2. 40
Organization 2. null
1. 350
2. 50
3 organization | null
1. 200
The main question is hot to write a sql as source for display to insert before each group a line with the value of the title of the table CRM_PLAN_PE column. Is it still possible? Perhaps you could suggest another method.
Notice will be used in the form of oracle where will be possible to change the data - I will make the necessary arrangements by trigger INSTEAD of.
Kind regards
Igor
Published by: user5528050 on 29.11.2012 02:23
Published by: user5528050 on 29.11.2012 02:24
Published by: user5528050 on 29.11.2012 02:25Hi, Igor,.
In this case, I think ROLLUP is a little simpeler GROUPING SETS, but you could do it anyway:
SELECT CASE WHEN GROUPING (tab2.id) = 0 THEN TO_CHAR (tab2.id) ELSE tab1.title END AS col_1 , SUM (tab2.amount) AS col_2 FROM tab1 JOIN tab2 ON tab1.id = tab2.tab1_id GROUP BY tab1.title , ROLLUP (tab2.id) ORDER BY tab1.title , GROUPING (tab2.id) DESC , tab2.id ;
If tab2.id cannot be NULL, you can use
NVL ( TO_CHAR (tab2.id) , tab1.title )
instead of the CASE expression and simplify the ORDER BY clause to
ORDER BY tab1.title , tab2.id NULLS FIRST
-
Groups of layers PShop CC Panel - drag all the layers in the Group at a time?
In Photoshop CS5, when I have several layers in a group, I can move (click-and - drag) all layers at once in the group by the presence of the Group layer selected. Now that I work in a place that uses CC, I noticed that I can't do that in CC. Even though I have the 'Group' selected layer, I can only drag a layer that resides within this group and not the whole group. Is there a setting in CC that control the behavior of the functioning of the Group selections? Thank you-
You have checked or unchecked auto-sélectionnez it the option in the options bar?
Maybe it's because her you have unchecked the option which moves only one layer and all group works even after you select the group.
-
How to remove all the groups from shared Services?
Hi, how can I remove all the native directory of Shared Services in the form of groups?
Select the groups under native, select Show all, press shift or control, you can select groups, once the groups are selected, right click on and select Remove.
Thank you
~ KKT ~.
-
Why can I not select the entire Repeater object?
I have a feeling that it is a simple question:
I use a Mac Pro with 10.10.5 and AE 2015.0.1 Release.
When I add a Repeater to a shape layer, I can not select the Group of repeated objects (via the bounding box) ('parent' and 'children'). It only allows me to choose the parent.
I'm doing something wrong here? Something uncontrolled?
I want to create long shapes and manipulate in 3d, but I'd really rather not do the whole thing just to be able to elect the parent object.
Change this behavior in CC. If you want to see all the layers in a selection box, then you must either wait for a update or work on the CS6. Because I saw blue, I thought that you have been affected by a change in behavior in CC or newer. Personally, especially when forms are complex, I find it easier to be able to discern the basic form so I can double click and edit just this form.
-
Toggle visibility for the Group layer
With the help of this forum, I got a script that activates / deactivates the visibility of a specific layer without selecting the layer.
I would like to know if the same functionality can be obtained for a layer group.
In other words the script can toggle the visibility of a layer with output actually group by selecting the Group of layers?
I understand that some parts of Photoshop are not scriptable and wan to ensure that it is not one of them, before I was embarking on the creation of the script.
I have a script that does what you need. Can't remember if I got here, but I know that the scripts here guys are geniuses and can help you with almost anything. That being said, here's the script you need. All you need to do is replace the three parties "Insert Layer Name Here" with the name of the layer you want to toggle. Don't thank me, thank the guy who wrote (probably someone here)
var targetID = getLayerIDByName('Insert Layer Name here'); if(undefined != targetID){ if(getLayerVisibilityByID( targetID ) ){ hideByName('Insert Layer Name here'); }else{ showByName('Insert Layer Name here'); } } function getLayerIDByName(name) { try{ var ref = new ActionReference(); ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "LyrI" )); ref.putName( charIDToTypeID( "Lyr " ), name ); return executeActionGet(ref).getInteger(charIDToTypeID( "LyrI" )); }catch(e){} }; function getLayerVisibilityByID( id ) { var ref = new ActionReference(); ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Vsbl" )); ref.putIdentifier( charIDToTypeID( "Lyr " ), id ); return executeActionGet(ref).getBoolean(charIDToTypeID( "Vsbl" )); }; function hideByName(name) { var desc = new ActionDescriptor(); var list = new ActionList(); var ref = new ActionReference(); ref.putName( charIDToTypeID('Lyr '), name ); list.putReference( ref ); desc.putList( charIDToTypeID('null'), list ); executeAction( charIDToTypeID('Hd '), desc, DialogModes.NO ); }; function showByName(name) { var desc = new ActionDescriptor(); var list = new ActionList(); var ref = new ActionReference(); ref.putName( charIDToTypeID('Lyr '), name ); list.putReference( ref ); desc.putList( charIDToTypeID('null'), list ); executeAction( charIDToTypeID('Shw '), desc, DialogModes.NO ); };
EDIT-Oops, I just realized that it is only for layers, not groups. But I hope that it is a starting point
-
Hello
How can I align a group of objects in the center of the artboard or elsewhere. RT now it aligns each object in the group toward the Center, but I need the group as a whole to be centered.
Kind regards
Frank
You have in fact the Group of grouped objects?
Commannd + G or CTRL + G, of course, you select all the objects first.
Select the group with the selection tool, and then choose alignn to the art Council. Should do the trick!
-
Has features missing from Windows XP in Windows 7?
I'm doing a simple import of photos using the option 'Import pictures and videos using Windows' native Autoplay.
In Windows XP, I could choose what images to import and give them all the basic name custom during the import process, with each photo added later with a "001", "002" etc using the scanner and Camera Wizard. It is very convenient because it could have been hundreds of photos on some of my cards from a long period of shots, I could run the tool more than once for different groups of photos that I would choose Import, and the pictures would be get named sequentially and stored in their files you want immediately. I imported thousands of photos in this way.
This new tool for Windows 7 allows me to add tags to all of the photos on the cards and devices and name photos after their date, or on the label, or other combinations of that... but why doesn't this new tool in Windows 7 suppose I want to import every single photo on the card device / I just connect and more that I want them all to have the same tag assigned to them? It's stupid and useless - there, makes only has pictures of a theme on their card at any time that they connect to import their photos and always wants to import everything each time?
To illustrate this point, let's look at my current situation. I'm just on vacation in Europe and took pictures to more than one place, I visited, of course and now I would like to mark photos with the location of the names individually... or even more, I would like to actually name photos when importing with the name of the place in the picture. Scanner and digital camera Assistant & would do that, no problem - you just had to run the tool once for each different group name, then select the appropriate images to import with the same group name. It has been easy. This type of naming is far superior to the addition of tags to images named simple-list or date-wise because you can tell what the image file in your library that you want to open just by going to (or get) the group name. Want to see pictures of St. Peter's Basilica? If you named the photos with that (added with 001, 002 etc), then simply browse to that name in your folder of photos «The Italy, holiday 2010» Without trying to find photos Tags into the sea by the name of "IMG20100324005" - soup and no program Photo Gallery Windows Live Photos or necessary Picasa.
This new program in Windows 7 for the import of images does not appear to be able to handle the very handy feature of its predecessor Windows XP. It's very frustrating to have opted for the version of Windows newer and supposed to be 'better' but find several programs that have been very useful for XP have valuable features removed or are no longer present at all (like how Windows 7 is no longer a Clipboard Viewer - that has great idea that is?).
So is it possible to recover the image import feature I apparently lost by 'redevelopment' of Windows Windows 7? I could of course go and buy an image import and edition program (Smart Photo Import very nice for the price, a quick search I just do), but as this feature was native in Windows XP it is still stupid to have to buy a 3rd party simply program now because Microsoft does not understand the idea of keeping popular features in their software and seems rather "he dumb down.
Any help to select the pictures I want to import and naming them when importing with a custom group name using the import wizard would be greatly appreciated... + 10 GB of photos and videos of this trip is sitting & waiting for a solution!
Has features missing from Windows XP in Windows 7?
I'm doing a simple import of photos using the option 'Import pictures and videos using Windows' native Autoplay.
In Windows XP, I could choose what images to import and give them all the basic name custom during the import process, with each photo added later with a "001", "002" etc using the scanner and Camera Wizard. It is very convenient because it could have been hundreds of photos on some of my cards from a long period of shots, I could run the tool more than once for different groups of photos that I would choose Import, and the pictures would be get named sequentially and stored in their files you want immediately. I imported thousands of photos in this way.
This new tool for Windows 7 allows me to add tags to all of the photos on the cards and devices and name photos after their date, or on the label, or other combinations of that... but why doesn't this new tool in Windows 7 suppose I want to import every single photo on the card device / I just connect and more that I want them all to have the same tag assigned to them? It's stupid and useless - there, makes only has pictures of a theme on their card at any time that they connect to import their photos and always wants to import everything each time?
To illustrate this point, let's look at my current situation. I'm just on vacation in Europe and took pictures to more than one place, I visited, of course and now I would like to mark photos with the location of the names individually... or even more, I would like to actually name photos when importing with the name of the place in the picture. Scanner and digital camera Assistant & would do that, no problem - you just had to run the tool once for each different group name, then select the appropriate images to import with the same group name. It has been easy. This type of naming is far superior to the addition of tags to images named simple-list or date-wise because you can tell what the image file in your library that you want to open just by going to (or get) the group name. Want to see pictures of St. Peter's Basilica? If you named the photos with that (added with 001, 002 etc), then simply browse to that name in your folder of photos «The Italy, holiday 2010» Without trying to find photos Tags into the sea by the name of "IMG20100324005" - soup and no program Photo Gallery Windows Live Photos or necessary Picasa.
This new program in Windows 7 for the import of images does not appear to be able to handle the very handy feature of its predecessor Windows XP. It's very frustrating to have opted for the version of Windows newer and supposed to be 'better' but find several programs that have been very useful for XP have valuable features removed or are no longer present at all (like how Windows 7 is no longer a Clipboard Viewer - that has great idea that is?).
So is it possible to recover the image import feature I apparently lost by 'redevelopment' of Windows Windows 7? I could of course go and buy an image import and edition program (Smart Photo Import very nice for the price, a quick search I just do), but as this feature was native in Windows XP it is still stupid to have to buy a 3rd party simply program now because Microsoft does not understand the idea of keeping popular features in their software and seems rather "he dumb down.
Any help to select the pictures I want to import and naming them when importing with a custom group name using the import wizard would be greatly appreciated... + 10 GB of photos and videos of this trip is sitting & waiting for a solution!
===========================================
Perhaps the following links will propose a few ideas:Windows 7 - change settings for importing pictures and videos
http://Windows.Microsoft.com/en-us/Windows7/change-settings-for-importing-pictures-and-videos
(don't forget to extend "Import in the view settings" at the bottom of the page)Windows 7 - How to make photos from my camera to my computer?
http://Windows.Microsoft.com/en-us/Windows7/how-do-I-get-pictures-from-my-camera-to-my-computerYou might find the free Picasa software or Windows Live Photo Gallery
to be useful:(FWIW... it's always a good idea to create a system)
Restore point before installing software or updates)Download Windows live Photo Gallery
http://explore.live.com/Windows-Live-Photo-Gallery
(There are other applications included in the download...
Uncheck the ones you don't want)Picasa
http://Picasa.Google.com/Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.
-
Select the anchor point of the Group and anchor it to the PointInsertion
Hi all
How to select the anchor point of the Group and dock it at the point of insertion of the document in indesign cs5.5 using javascript or vb.net
You need get a reference to your group - call the myGroup - and the other to the PointInsertion where you want it anchored - call - the myIP. Given those, you can achieve your goal (in CS5 or later) by:
myGroup.anchoredObjectSettings.insertAnchoredObject (myIP);
You can specify a second parameter, if you want that specifies the position of anchor:
myGroup.anchoredObjectSettings.insertAnchoredObject (myIP, AnchorPosition.anchored);
That should help you get started.
Dave
-
Need help in the optimization of the query with the Group and joins by clause
I'm having the problem by running the following query... It takes a lot of time. To simplify, I added the two tables FILE_STATUS = stores the file load details and COMM table Board table job showing records treated successfully and which was communicated to the other system real. Records with status = T is trasnmitted to another system and traansactions with P is waiting.
Here's the query I wrote to give me the details of the file that has been loaded into the system. He reads the table of State and the commission files to display the name of the file, total records loaded, total at the table of the commission and the number of records which has finally been passed successfully loaded (Status = T) with other systems.CREATE TABLE FILE_STATUS (FILE_ID VARCHAR2(14), FILE_NAME VARCHAR2(20), CARR_CD VARCHAR2(5), TOT_REC NUMBER, TOT_SUCC NUMBER); CREATE TABLE COMM (SRC_FILE_ID VARCHAR2(14), REC_ID NUMBER, STATUS CHAR(1)); INSERT INTO FILE_STATUS VALUES ('12345678', 'CM_LIBM.TXT', 'LIBM', 5, 4); INSERT INTO FILE_STATUS VALUES ('12345679', 'CM_HIPNT.TXT', 'HIPNT', 4, 0); INSERT INTO COMM VALUES ('12345678', 1, 'T'); INSERT INTO COMM VALUES ('12345678', 3, 'T'); INSERT INTO COMM VALUES ('12345678', 4, 'P'); INSERT INTO COMM VALUES ('12345678', 5, 'P'); COMMIT;
In production, this request has several joins and takes a long time to deal with... the main culprit for me is the join on the COMM table to count the number of number of transactions sent. Please can you give me tips to optimize this query to get results faster? What I need to delete the Group and use the partition or something else. Help, please!SELECT FS.CARR_CD ,FS.FILE_NAME ,FS.FILE_ID ,FS.TOT_REC ,FS.TOT_SUCC ,NVL(C.TOT_TRANS, 0) TOT_TRANS FROM FILE_STATUS FS LEFT JOIN ( SELECT SRC_FILE_ID, COUNT(*) TOT_TRANS FROM COMM WHERE STATUS = 'T' GROUP BY SRC_FILE_ID ) C ON C.SRC_FILE_ID = FS.FILE_ID WHERE FILE_ID = '12345678';
Don't know if it will be faster based on the information provided, but analytical functions offer an alternative approach;
select carr_cd, file_name, file_id, tot_rec, tot_succ, tot_trans from (select fs.carr_cd, fs.file_name, fs.file_id, fs.tot_rec, fs.tot_succ, count(case when c.status = 'T' then 1 else null end) over(partition by c.src_file_id) tot_trans, row_number() over(partition by c.src_file_id order by null) rn from file_status fs left join comm c on c.src_file_id = fs.file_id where file_id = '12345678') where rn = 1; CARR_CD FILE_NAME FILE_ID TOT_REC TOT_SUCC TOT_TRANS ------- -------------------- -------------- ---------- ---------- ---------- LIBM CM_LIBM.TXT 12345678 5 4 2
-
Impossible to navigate to and select the menu buttons during playback of DVD on TV
I use DVD Studio Pro 4.2.1 on iMac OS 10.6.8 (using old BONES of FCP 6.0.6).
I have two DVD players for my TV and a Sony DVP-NS57P-GE GE1105P.
For the video I created, I have two buttons on the main menu 1, 'Play' and 'Chapters' which goes to menu 2 with my links 7 chapters. This perfect mode DVDSP simulate all the works by clicking on these buttons, but I can not click on these buttons of menu 1 with one of my remotes for DVD player when viewing on TV. Movies usually have a menu with buttons like play, scenes, etc. that I can navigate to with my remote.
Remote controls work fine, I can use its buttons to move to the previous or next chapter while the video plays and the Sony has a strange menu page of access to the chapters but it would be awkward and should not be necessary. I just want someone to be able to navigate on my menu page 1 and select the link to chapters. Not really concerned about "play" button since someone can click play on the remote control.
So, I apparently need to change a few settings DVDSP. What I'm missing here? Google it and I tried manual DVDSP, but no luck.
Thank you very much.
Jim
No function edit posts, so I have to put this in a response, I guess. This layout of the forum is so bad, was so much better several years ago. It's looking like my post does not get a response for a reason, but in the cases where it does, I need to update.
It seems that I am able to navigate to these buttons, I just couldn't see that because the 'Selected' colors, I put to them do not work. I have all the colors of the selection state set for Normal, selected and active. When I use my DVD in my sell order DVD or mode DVDSP simulate with button style control remotely to this topic, when I browse to the top, bottom, left or right, nothing to change the color of links, so there is no way of knowing when I am on a link (I have 9 on a single page) and you want to select and then press ENTER.
I've hunted throughout the manual, google, YouTube and cannot find the answer to this problem.
-
How can I access the groups selected in DisplayNewUserDialog?
I'm developing a user for a Deployment Manager so that the production manager can add users they are formed. I changed the simple IO to add a button 'Manage users', which is implemented as a VI.
I have this pretty much work except when I add a user using the DisplayNewUserDialog, I see no way to access the groups that can be selected in the dialog box. Select a group in the dialog box apparently does nothing. I save the user sent to the dialog box object and "sticking". But group selection doesn't fit or I see nothing to access the selection. With the help of the DisplayEditUserDialog on the same user object correctly records the group memberships selected without having to make an additional call.
I see that in the example CreateDeleteUsers.seq, it is a step 'Add the user to the group' who up the group by the name chosen by the user. To paraphrase the steps:
- Add a new user: RunState.Engine.UsersFile.UserList.SetPropertyObjectByOffset (0, 0 x 1, Locals.User)
- Add the user to the Group (defines the privileges): RunState.Engine.GetUserGroup (Locals.GroupName). Members.SetValStringByOffset (0, 0 x 1, Locals.User.AsUser.LoginName)
I don't see how I can retrieve this group name ("Locals.GroupName" above) the box of dialogue, or of the user object that is returned from the dialog box programmatically. Is this a bug?
Hi Gizmogal,
Your application will definitely work. Access to the
RunState.Engine.UsersFile.Data.UserTemplates
well I have mentioned, we must use a search string: -
I installed virtual router manager v1.0 but his does not work. When I leave router virtual by connection to the local network from my laptop, its shows an error. It is «the group or resource is not in the appropriate State to make the request in question» Please give me the solution of this problem. I want to start the virtual router and use the internet connection with other devices.
I installed virtual router manager v1.0 but his does not work. When I leave router virtual by connection to the local network from my laptop, its shows an error. It is «the group or resource is not in the appropriate State to make the request in question» Please give me the solution of this problem. I want to start the virtual router and use the internet connection with other devices.
Thank you so much for viewers. Virtual router works properly. I use internet for my laptop for my other devices.
-
Select the Tunnel-Group based on OS devices
Hello
having an ASA5512x is possible to have anyconnect-dial-in-PC-users asking their IDs AND also a one-time-password
Whereas smartphone users only need to provide their username and a password without the need to manually select the profile?
I've set up two groups of tunnel:
(1) requires an LDAP server for authentication
(2) is in contact with a RADIUS server running the software One Time Password.
Is it possible to have the asa affect smartphone users (based on their OS) that it automatically uses the first profile (which has limited access to the resources of the intranet) and Anyconnect-PC-users pinned to the second category of tunnel? Dynamic access policies seem to be able to differentiate only ' in' a tunnel-group.
Thank you very much!
Kind regards
David
I never tried this way, but if it does not (as I suspect) there is a solution:
- Point your customers on the two different groups of tunnel with the help of tunnel-group-URL.
- Later in the DAP impose that the customer does not use the wrong tunnel-group.
Maybe you are looking for
-
Remove the transmission of Messages/Text Message
An old and damaged iPad (I own is more) still appears in settings/Messages/Text Message Forwarding > It is disabled (the green dot is hidden). How do I remove it from the list? The device has been removed from 'My Profile support' I tried to go to iC
-
HP Deskjet 1056 (all-in-one) do not print all of a sudden
Thank you in advance for your answers and direction. For some reason, I could not get my PC to print at all (no test do pages either). I just rebuilt my PC with Windows 7, I have done this literally 100 times before and have never encountered this di
-
How can I change the n and m?
I signed up for xbox live and put the wrong email address (* address email is removed from the privacy *). How can I change the n and m?
-
Receive 0x8000FFF, 0 x 80070570 and 0 x 80070422 error codes
Can not recover after infection by the virus; you try to run "Services MSC" and nothing works. Need HELP please.
-
My cd/dvd drive stop working.
I have vista and I went to rip a cd and it says to install a cd player. In addition, the discs (CDs and DVDs) are not listed under drives in the computer. I have something to turn off somehow?