Apex 4.2: any workarounds for group by alias?

Hello
I have six db fields containing numbers 1-10. I need to select these fields into one "column" to drive a chart which requires SQL in the format:
select link, name, value from tableI've come up with a union statement that returns the fields into one "column" but this uses an alias and I am unable to group by the alias. I am also unable to group by column number. My table cannot sensibly be restructured, i.e. putting columns as rows.
I figure the thing to do is to create a view (would i then be able to group by a view column?). Am I right and can anyone suggest the right sort of syntax?
My UNION statement looks like this:
Select null link, 'Q1' label, col1 question
from table
union all
Select null link, 'Q2' label, col2 question
from table
union all
Select null link, 'Q3' label, col3 question
from table
union all
Select null link, 'Q4' label, col4 question
from table
union all
Select null link, 'Q5' label, col5 question
from table
union all
Select null link, 'Q6' label, col6 question
from tableThanks
Emma

If you are on 11g this looks like an UNPIVOT.
Not sure if this is what you want:
WITH mydata AS
   SELECT  9 col1, 8 col2, 7 col3, 6 col4, 5 col5, 4 col6 FROM DUAL
SELECT 'X' link, label, question
  FROM mydata
UNPIVOT ( question FOR label IN( col1 as 'Q1'
                                , col2 as 'Q2'
                                , col3 as 'Q3'
                                , col4 as 'Q4'
                                , col5 as 'Q5'
                                , col6 as 'Q6'
LINK LABEL   QUESTION
X    Q1             9
X    Q2             8
X    Q3             7
X    Q4             6
X    Q5             5
X    Q6             4Please read SQL and PL/SQL FAQ
Always Oracle version, sample data (CREATE TABLE and INSERT staments), logic and expected output.
When you put some code or output please enclose it between two lines starting with {noformat}{noformat}
i.e.:
{noformat}{noformat}
SELECT ...
{noformat}{noformat}
It's also considered a good practice to mark questions as answered when the answers are satisfying your question or provide additional details.
Regards.
Al
Edited by: Alberto Faenza on May 1, 2013 5:13 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Any workarounds for the X11 apps segmentation faults on intel with 10.4.8 ?

    Hi,
    We've an X11 application, compiled for PPC, which runs fine with a G5 iMac on 10.4.8. However, it crashes with a segmentation fault on a MacBook Pro with 10.4.8 (running through Rosetta).
    Searching the web, we found that this seems to be a widespread problem for X11 apps running on Intel Macs with 10.4.8.
    Has this been submitted as an important bug to Apple?
    Are there any workarounds for it?
    Is the problem specific to PPC-only builds, or does it also happen with Universal builds?
    Thank you for any hints you could give about this,
    cesar
      Mac OS X (10.4.8)  

    A powerpc-binary program running under Rosetta can only load powerpc-binary modules...can't cross in and out of emulation within a single process. Perhaps your program is trying to load a module from X11 that is present as an intel-only binary? Rosetta is certainly no future-looking cure-all, just a stop-gap to allow one to keep using older stuff, and it is kinda fragile sometimes. If your target audience is both powerpc and intel machines, compile as a universal binary so it's native for everyone.

  • Is there any workaround for URL & TABS

    Hi ,
    1.I have the following case mentioned at :
    URL region error when changing tabs
    2. I would like to know if there are any workarounds for this case, due to we urgently need this functionality.
    Thanks in advance
    Etay G

    Etay,
    The question on the post you referenced was answered thoroughly and has nothing to do with the subject of this post.
    If you have a new question, please post it here in full detail.
    Scott

  • Any workarounds for the 2880 pixel size limit?

    I have a client that would like a Flash animation that's 5440
    pixels wide, to span 3 widescreen monitors for a tradeshow
    presentation. Flash won't let me make the stage any bigger than
    2880 - does anyone know any ways around that limit?
    I Googled it and found out that you used to be able to scale
    the SWF beyond 2880 in an HTML file, and it would show well using
    Flash Player 7, but apparently that trick no longer works in
    Players 8+.
    Any other ways to make a single SWF that can span 3 large
    monitors?
    Thanks in advance,
    - Frank

    The problem here is the legacy flash document size constraint of 2880 x 2880 pixels. Why is this limitation still in place? Most screen have landscape orientation and we have this square constraint that turns out to be a waste if you are developing for larger screen displays and anything that is 4:3 or 16:9. Something does not add up here. What if someone needs to make a dual wide screen HD show that measured 3840 x 1080 pixels? We can do setup documents at 3840 x 1080 pixels in PowerPoint, PDF, Silverlight (at least this is what I have read regarding Silverlight), but not in Flash. Why not?
    If Flash is a platform… then it needs to spread its wings a bit and embrace all the potential uses that are non-web. Flash represents multimedia delivery to millions, but shackling it to the 2880 x 2880 pixel limitation for a document size is problem for many people now and looming for those working toward have the flash engine as a core component in media delivery. At least give us a dual Wide screen monitor resolution of 3840 x 1080 pixels instead of a square of 2880 x 2880 pixels – which no one really uses (at least I have not seen any sqaure screens lately). Hey, if Adobe decided to shave off on the unused pixels from the 2880 height (2880 – 1080 = 1800) of the format you get an additional 1800 pixels that could applied where it is needed – to the width of the document size… giving us a 4680 x 1080 pixel document. This could then be used for immersive simulation, game situations, and real-world wide-screen experiences.
    Sorry I don't have an answer, just the same question. "Any workarounds for the 2880 pixel size limit?"

  • Any workaround for - Like '%VALUE' to reference the index

    Hi
    I have an index on Col1 but it is not referenced because i am making like '%value'
    EX:
    where Col1 LIKE '%VALUE'
    this is a business request to search %Value and not Value%
    is there is any workaround for that ?
    Thanks

    Define working perfectly.
    Just because it's using an index doesn't mean it's efficient.
    One proper solution here is to create a function-based index to reverse the string.
    You could use the undocumented, unsupported REVERSE function to test but as a proper implementation you should probably implement your own reversing function.
    That way, instead of a leading wildcard, you end up with a trailing wildcard and you can use an appropriate index when suitable.
    e.g. something like
    CREATE INDEX i1 ON t1 (REVERSE(col1));
    SELECT *
    FROM    t1
    WHERE REVERSE(col1) LIKE REVERSE('%Value');

  • Is there any workaround for Bug 6644652 ?

    Hi
    This issue is documented in DBAppTables GTC Connector at Known issues:
    "Bug 6644652
    Reconciliation of account deletion is not supported. In other words, if a record is
    deleted from the target database, then this deletion is not reconciled into Oracle
    Identity Manager"
    Is there any workaround that can be used ?
    Thank You in advanced,
    Ionut

    EHLO!
    Today I ALMOST finalized my delete-recon (is for AD objects, but I think it may work in many contexts). As the pals said, you have to use the createDeleteReconciliationEvent method from the operations API.
    I had a big problem: I spent a day looking for a NullPointerException that was raised just when this method is called. I realized that there is not a problem itself, the exception was raised because I was launching from the Eclipse project! So, instead of develop all the stuff and then pass it to OIM, I had to maje the jar, put it into the ScheduleTask folder, and execute it with the Task Scheduler from the Design Console, or from the Admin Console.
    For a brief:
    1) make a class that extends com.thortech.xl.scheduler.tasks.SchedulerBaseTask
    2) implement the execute() method
    3) for creating the operator, you can call (tcReconciliationOperationsIntf)getUtility("Thor.API.Operations.tcReconciliationOperationsIntf") (getUility is inherited from SchedulerBaseTask)
    4) Make some Map object, with key/value pairs. Keys have to be the same as they appear in the Reconciliation Fields of the Resource Object, and at least you have to put the required ones. Call the method, the first parameter is a String with the RO ("Xellerate User", "AD User", "Exchange", etc).
    For example, you can make something like this:
                   HashMap hm = new HashMap();
                   hm.put("User ID", "drldap");
                   hm.put("objectGUID", "12345679");
                   try {
                        reconOps.createDeleteReconciliationEvent("AD User", hm);
                   catch(Exception e) {
                        e.printStackTrace(System.out);
    Hope it was helpful. Enjoy!
    DrLDAP!

  • Is there any workaround for exporting 24 bit AAF of OMF in soundtrack?

    Hi
    Soundtrack pro seems to have only 16bit AAF export function. Is there any workaround to be able to export a multitrack session in higher bit (24bit industry standard) resolution, in AAF or OMF format?
    I know Final Cut has 24bit AAF export funcion, but sending clips from soundtrack to Final Cut seems not possible. Only sending mastermixes to FC is possible. But I want to send individual clips to FC.
    Or any other suggestions are welcome for solving this problem.
    Thanks!
    Xske

    If Premiere offers you the option to use hardware encoding, then your card is recognized. There is normally nothing more to do.  If I understand you correctly, you are concerned that Premiere is not using the card.  There are 2 ways to check if it is:
    1. Install someting like GPU-Z (google it, it's free) to monitor the GPU. Start to encode something that will actually use CUDA cores, and you should see some activity reported, given as a percentage.  Keep in mind that CUDA is only used for some specific tasks (some effects, resizing) when encoding.
    2. Export a file that will use CUDA when encoding 2 times, once with hardware encoding enabled, and then with software only. Is there a difference in the time needed to complete the export?

  • Is there any workaround for log LNs in read-only env. UNEXPECTED_STATE

    I'm at 5.0.43 and encounter the same problem mentioned in The Berkeley DB Java Edition Package: BDB JE Library Version  11.2.5.0 (Release 5.0.55) Change Log
    Fixed a bug that caused an exception such as the following, when opening an Environment in read-only mode. This occurred under certain circumstances when a clean shutdown (final checkpoint) was not performed when the Environment was last used by a read-write process.
    I have below 2 questions:
    1) I want to know if there's any workaround to this problem without having to upgrade BDB-JE.
    2) Just want to make sure we will not have data compatible issue if we have to upgrade to the latest version
    Thanks for your help.

    This is a transient problem when opening in read-only mode.  It does not cause corruption or a compatibility issue.
    If you open the environment read-write and perform a normal shutdown (Environment.close), then it should be possible to open the environment read-only again.
    However, it is possible that it could happen again if the read-write process exits without calling Environment.close.  The only way to guarantee it won't happen again is to always call Environment.close in the read-write process before opening it read-only, or upgrade to the latest version of JE 5.
    --mark

  • Any workarounds for not supported features of XML Schema

    Hi,
    We are trying to generate JAVA source code by providing a xsd.
    This XML Schema file has all sorts of Identity constraints & attribute wildcards.
    Due to the above reasons I am unable to generate the code.
    Are there any workarounds? If so Please share those.
    Thanks & Regards,
    Priti Ranka

    I am sorry I did not mention the tech. being used.
    I am using JAXB for the above task.

  • Crosstab problem:  Any workaround for that?

    Post Author: jef.zapata
    CA Forum: Charts and Graphs
    Hi,
    I've got a mater report, in which I use a subreport as detail. My subreport consist as a crosstable. For each record of the master report, I pass in parameter a key to the subreport to get the appropriated crosstable. The problem is that for one crosstable, I can get multiple page, and when printing/previewing the master report, if the record row returns a crosstable on multiple page, I only got one page print: the next ones are missing.
    Is there a way to prevent that? Is there any workaround? maybee its my method that is not the best one to use in this case...
    Thanks!

    Define working perfectly.
    Just because it's using an index doesn't mean it's efficient.
    One proper solution here is to create a function-based index to reverse the string.
    You could use the undocumented, unsupported REVERSE function to test but as a proper implementation you should probably implement your own reversing function.
    That way, instead of a leading wildcard, you end up with a trailing wildcard and you can use an appropriate index when suitable.
    e.g. something like
    CREATE INDEX i1 ON t1 (REVERSE(col1));
    SELECT *
    FROM    t1
    WHERE REVERSE(col1) LIKE REVERSE('%Value');

  • Any workaround for maxTouchPoints=1 issue on Android device?

    Hi all,
    Does anybody know a workaround for incorrect maxTouchPoints (always return 1) on Android device?
    I've reported the bug in the following ticket. I'm urgently looking for a way to work around this issue.
    https://bugbase.adobe.com/index.cfm?event=bug&id=2947368
    Any hint is appreciated.
    Thanks

    Hi,
    I just wanted to follow up.  It looks from your bug comments like the issues you experienced in AIR 3.2 have been resolved AIR 3.3.
    Are there any outstanding problems that you're seeing with regard to the issues you've described that we need to look into further for AIR 3.3? 
    Thanks!

  • Any workaround for mixed media playlist on ipod classic?

    On Itunes I can create a mixed media playlist (music and music videos)
    I can put that playlist on my ipod.
    But when it comes to playing the video the ipod will only show the audio if coming from the playlist.
    It shows up fine when being accessed via music videos.
    If I plug the ipod into itunes, and click "on this ipod" my playlist shows up.
    When I play the playlist on the ipod and a video comes up, the video starts in itunes with no problem.
    Does anyone have a workaround for this to happen on the ipod classic?
    Can I encode audio only in mp4?
    Then maybe all songs will be listed as music videos, and those with audio only will display the cover?
    Just brainstorming out loud here.
    Thanks,
    Dan
    P.S. Just noticed other people had a similar question.  A lot of discussion but no definitive answer.
    Maybe someone will have discovered a workaround since the last thread.

    I found the problem !!! I had many smart playlist with a rule that was -> "Album - is - "empty"". It seems that the new iTunes this kind of "empty rule" would not accept. I had to add a new rule -> "Playlist - is - Music". Now it shows all the songs on the iPod.
    It seems to be an Apple Bug on iTunes. I hope they can resolve this problem.

  • Are there any workarounds for multiple PDF files created for a single Word 2011 document?

    I am running...
    Mac OS X Version 10.6.8
    Word for Mac 2011
    Adobe Acrobat X Version 10.1.0
    I am working with 100 plus page Word documents that go back and forth between portrait and landscape layouts. When I attempt to create an Acrobat PDF document (or one using the native Mac PDF function), I end up with 10 to 15 separate PDF documents. One person suggested that I simple stitch them together, which is an inordinate amount of work as compared to how simple it is do on my PC with older versions of Acrobat and Word. However, I have noticed that the margins are way off and the pagination is off sometimes too. So even this workaround is not the answer. I last talked to Microsoft, Apple, and Acrobat tech support about five weeks ago. Each blaming the other two but saying they were working together to solve the problem. My recent searches of forums has not revealed any solutions nor have updates changed anything.
    As I am anticipating the day when my old PC stops working, I am searching for a possible workaround or other solution for this problem.

    Thanks for your reply.
    The tip-off may be this.  In Word 2007 on my pc when I print the document to a printer, Word generates 1 print file for the entire document. If I print to PDF, one print file is generated by Word and Acrobat creates a PDF from this file.
    What I just discovered by accident was that when Word for Mac 2011 prints the same Word document to a printer it creates about 10 different print files.  So instead of a 100 page PDF document I end up with 10 PDF documents of 1 to 30 pages depending where the page orientation shifts in the Word document. If you print to a printer that is not turned on, you can see all of the files stacked up in the printer queue. I suspect that Word for Mac 2011 generates 10 different print files during the PDF creation process and therefore Acrobat logically creates 10 different PDFs.  Unfortunately, there are margin errors and other layout errors in these 10 different PDFs so stitching them together is useless.
    I am beginning to think that the way Word for Mac 2011 prints documents is simply incompatabile to Acrobat or the PDF creator that is native to the Mac OS.
    I just think that this is a problem that Microsoft is going to have to fix.

  • Curve 8520 Menu key not working! Any workaround for this?

    I bought a Curve 8520 from ebay for a bargain price as the menu button (one with blackberry logo on) didn't work. It clicks and makes contact with the metal circle underneath but doesn't open the menu. I've also tried pressing the metal bit below the rubber with a pointy thing, still no joy so I can only assume its a hardware fault. As I don't know the phones history, I have no idea whether it could be water damage, been dropped, keys pressed too hard etc etc...
    As I bought it on ebay, I cant take it back to the store. Its incredibly frustrating as it is the most important button on the entire handset. I've tried wiping it and reloading the OS etc, tried every kinda of software workaround I can think of but no joy.
    However, I know that the buttons on the side of the phone can be customised to do different functions, so is there a way to duplicate/spoof the menu button to another different button? Or failing that, as the phone supports Java is there some kind of application which lets you re-map the keys to custom specifications?
    I've seen many forums and many other threads where people are complaining of the same problem, I'm at my wits end, and to buy the same model brand new is £120, which seems a lot for a phone thats nearly obsolete.
    Any pointers, hints, tips, useful shortcuts, or any info on this problem would be greatly appreciated!
    thanks

    This same thing as been happening to me! I went to the Verizon store today and talked quickly with a representative and he said "you need to update your software or you need to get a new phone." He was rude and he was wrong about having to update my software because I did that and it says I am up to date.
    If anyone else is also having this issue and knows how to solve it WITHOUT talking to the tech people and getting a new phone, please let us know!

  • Any workaround for dealing with MS Word docs without using MS Office?

    Hi, I've been emailed a highly formatted MS word document that I need to fill in and email back. Trouble is that my copy of Pages 08 says 'text frames aren't supported and have been converted to text boxes' - the result being that the form is jumbled up to say the least and unusable, is there a workaround without having to use Microsoft word itself?
    thanks
    Simon

    You could try http://www.openoffice.org , or
    http://www.panergy-software.com/products/lp/we/gn_op.html
    However with very complex formatting you may well find that it's just not possible for other programs to handle it.

Maybe you are looking for

  • Suggested improvements for iPod Nano G5

    I love using my iPod at work quite a bit. I keep it in my pocket for convenience. But with it there, I cannot see the display. Today I checked the battery and it was almost dead. I thought it would be a good idea if the Nano could produce a series of

  • DMP TABLE IMPORT IN ORACLE 10G

    Dear All, i have an Oracle 8i DB in Windows 2000 server . I am export One table to x.dmp. I have an Oracle 10g Db in Windows 2000 server with Cluster option. One is data base server and 2 is O/s of Windows 2000 . So, How to import .dmp to 10 g db. I

  • Why is iTunes window open in every mission control window

    I have a 27" iMac with the latest Mac OS and the latest version of iTunes. I have my iTunes library installed on an external Hard Drive. When I open iTunes, every mission control window has an open iTunes window? 10 screens 10 open iTunes windows? Th

  • Dynamic Calc Issue - CalcLockBlock or Data Cache Setting

    We recently started seeing an issue with a Dynamic scenario member in our UAT and DEV environments. When we tried to reference the scenario member in Financial Reports, we get the following error: Error executing query: The data form grid is invalid.

  • LDAP as data source for UME

    Trying to use a SSL enabled LDAP (Sun) for data source for UME.  It seems that I can't use SSL directly from GRC CUP 5.3. Followed the instructions in saphelp, but when I test the connection, it gives me "Connection test with user path failed". The f