Grouping on the field created with substr

I don't know how to get around this problem.

Here are the contents of the field, point, I need to group by. The name of the element is actually the string AFTER the 'Test' and BEFORE 'Hour '.

TestNodAHour-03
TestNodCHour-00
TestNodBHour-01
TestNodDHour-02

Thus, in the example above, the element names would be "NodA", "NodC', 'NodB', 'NodD '.

I need to enter charges for these items (i.e. the substrings) names and come up with totals, so I tried the following:
SELECT
       SUBSTR ( item , 5 , 4 ) AS Item , 
       COUNT(*)
FROM 
    table_name
WHERE
 Item_Type = '666' 
GROUP BY item
ORDER BY item
The report header now has the right name, but the data are actually get wrapped by long names - the names actually in the fields. Is there anyway to group by the substr? Or I approach this all wrong?

Brad

Hello

When you assign a column alias in a query, you can use it in the ORDER BY clause, but nowhere else in the same query.
So, when you are referring to 'article' in the GROUP BY clause, referring to the column called point, not the called alias element.

Using a column as an alias is confusing name. try to avoid this.

You can repeat the expression in the GROUP BY clause:

SELECT
       SUBSTR ( item , 5 , 4 ) AS Item ,
       COUNT(*)
FROM
    table_name
WHERE
 Item_Type = '666'
GROUP BY SUBSTR ( item , 5 , 4 )
ORDER BY item

or you can assign the alias in a subquery. Then, it can be used in the GROUP BY clause (or elsewhere) in the Super-requete:

WITH     reduce_item  AS
(
     SELECT
          SUBSTR ( item , 5 , 4 ) AS Item ,
     FROM
          table_name
     WHERE
          Item_Type = '666'
)
SELECT    item
,       COUNT (*)
FROM       reduce_item
GROUP BY  item
ORDER BY  item

Tags: Database

Similar Questions

  • I created a project with the first 14 and now subscribed elements trial version. However, when I open it there still the band "created with the trial version...". "in the middle of the page. How can I get rid of this?

    I created a project with the first 14 and now subscribed elements trial version. However, when I open it there still the band "created with the trial version...". "in the middle of the page. How can I get rid of this?

    SAMT

    Removal of watermark Adobe Premiere elements 14 test of the project file... Open the project file of 14 trials in 14 items purchased and then first Expert rendered workspaceTimeline Menu/delete the files. Then restore the timeline content.

    You can not remove the watermark from Adobe to an export of the trial even after you bought the product.

    Some of us have found that just opening the project of tryout in removes it from Premiere Elements purchased the Adobe watermark. Determine the way that works for you.

    Please let us know if everything above worked for you.

    Thank you.

    RTA

  • destroy the page created with C++

    Hello

    How do I destroy a thrust from a NavigationPane page when the page is created with C++.

    Here is the code:

    // applicationui.cpp
    
    Page* ApplicationUI::doLoadPageDetails(QString fn) {
    
      QmlDocument *qml = QmlDocument::create("asset:///PageDetails/PageDetails.qml").parent(this);
     [...]  Page *newPage = qml->createRootObject();
    
      return newPage;
    }
    

    When I open the app displays a ListView. When I push on one of the elements in the list the PageDetails page is shown.

    // main.qml
    
    [...]onTriggered: {
                        var selectedItem = dataModel.data(indexPath);
    
                        var page = app.doLoadPageDetails(selectedItem.toString());
    
                        navigationPane.push(page);
    }
    

    Now, I have written a delete action in the application.cpp

    void ApplicationUI::popFinished(bb::cascades::Page* page) {
        delete page;
    }
    

    and used in the main.qml in onPopTransitionEnded:

    onPopTransitionEnded: {
            // Destroy the popped Page once the back transition has ended.
            app.popFinished(page);
        }
    

    But it's not destroy the page. Can someone tell me how to get destroyed page when you press the ButtonBack?

    The count method gave me what I expected when I start the application number is 1-> home page.

    When I click on an item on the next page open-> count = 2.

    When I come back-> count = 1.

    But I solved the problem.

    The second page is filled with information from functions in C++. So in my additional popFinished function on page "Delete" now also clear the list of contacts with the clear function, as I said before.

    void ApplicationUI::popFinished(bb::cascades::Page* page) {
        Contacts.Clear();
        delete page;
    }
    
  • Limitation of certain groups in the field of NT to VPN in the network

    I set up our VPN 3015 for their our NT domain authentication. My question is. Is there a way to limit authentication to a global group in the domain. For example I want to limit to only users who are in the world group "VPNACCESS" to access our vpn...

    If you have a user with the correct information and a user/pass valid on the NT domain, they will be able to connect. Since you do not know which ip address your customers come over that probably, you don't really power limit via the hub. Unless you put this information on another device, his is not going to be possible. You could use the local database on the hub for authentication or send it to a radius server if you want to restrict users. If there is nothing, it will be on your global group on your server permissions.

    Kurtis Durrett

  • RoboHelp 2015: Several output types that are not available when you open the project created with RH9

    I recently upgraded from RoboHelp 9 in RoboHelp 2015, and I have installed all updates. I use WebHelp output for most of my projects. I would like to use the new features of HR 2015, specifically the release of HTML5 sensitive; However, when I open a project created with RH9, this type of output is not available. This type of output, and many others is not listed as options can I choose from eBook including HTML5 Multiscreen, and others. I tried to create a new project with HR 2015, and import my RH9 project files, but the sensitive HTML5 output and others remained unavailable. Are there settings I can change into my existing project or HR 2015 in order to use these features and new types of output? Recreate all the subjects in HR 2015 seems to be a very undesirable solution.

    Operating system: Windows 7, 64 bit

    Right click on the pod output and select new.  All options will be listed.

  • Why the MAX aggregate function is used in SQL upon accession of the fields created in the designer?

    Of course Certified Developer, you can see the left join to include the fields in the SU_EXTENTION_DATA table. Why MAX is used when retrieving these values?

    ! Wont start-

    LEFT JOIN

    (SELECT

    REF_NO "REF."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500033 THEN VALUE_DATE END) "DOB",.

    MAX (CASE WHEN EXTENSION_FIELD_REF = VALUE_STRING END THEN 500034) "E_CONTACT."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500035 THEN VALUE_STRING END) "E_CONT_NO."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500036 THEN VALUE_TEXT END) "MED_HIST."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500037 THEN SELECT_TEXT END) 'PREF_CONTACT '.

    OF SU_EXTENSION_DATA

    LEFT JOIN SU_SELECT_VALUES ON

    SU_EXTENSION_DATA. VALUE_SELECT = SU_SELECT_VALUES. REF

    WHERE CORE_ENTITY = 5

    REF_NO GROUP) X ON AR_PERSON. REF = X.REF

    ! End custom-

    When you do you must include all the fields that have been selected as criteria for grouping the aggregation OR use false features like MAX (more likely it's easier way when the result field is expression).

  • Worth checking the value of the field date with formcalc

    Hi, my apologies if this was requested. I found some discussions in the forums that deal with issues similar to the search, but the solutions did not help me any so I decided to start a new discussion.

    I have a field called date1 and I have a field called rate. Quite simply, all I want to do is determine the default value which is held at rates based on the question to know if date1 is set before the 01/07/2011.

    Here is what I tried with no luck.

    If (Date2Num (form1. #subform [0].)) Table1.row2.Date1.FormattedValue, ' DD/MM/YYYY') > = ' 01/07/2011 ") then '.

    Form1. #subform [0]. Table1.row2.rate1.RawValue =.555

    on the other

    Form1. #subform [0]. Table1.row2.rate1.RawValue =.51

    endif

    I also tried several other pieces of code, including a java script with no luck. I have to assume that my mistake is somewhere in the way that the field "compares" the datefield with the value that specify in the formula.

    I'm a newb total form so I apologize if this comes off a little ignorant.


    Thanks for any help I receive, in advance.


    C. S.

    The function Date2NUm will return you the number of seconds that have elapsed since the time, so you will need to compare the number of seconds that have elapsed since the era for 01/07/2011... .so

    If (Date2Num (form1. #subform [0].)) (Table1.row2.date1.FormattedValue, 'MM/DD/YYYY') > = Date2Num ("01/07/2011", MM/DD/YYYY")) then

    Paul

  • Any ideas why weather script will not appear in the index created with DW

    For an example of what I want to do with DW, please see my page now created with CoffeeCup. It will cost $49.

    http://96.9.48.31/

    This did not require a moment of my time asking them for help. It is not perfect and there are a lot of code that could be cut out, but it gives me results. I need assistance in support of DW to do what I know, the software can do, but maybe not easy at the beginning.

    Why the weather script does not play when the page is created with DW, but when created with Publisher and cup of coffee?

    Any help would be greatly appreciated.

    I want to use Dreamweaver, really I do. I have a whole database downloaded with the software of connection Member, just waiting for me to install. I don't install it until I first get a handle on a bug of ugly time.

    atmydeskworking wrote:

    Why the weather script does not play when the page is created with DW, but when created with Publisher and cup of coffee?

    The reason that the weather-report is not working in the Dreamweaver version of the page is that you have a gap between the words 'white' and '&' in the link below. Delete the gap and it will work.
    
    http://weatherreports.com/jscript.html?width=234&height=60&theme=white &location=Fairfax%2C%20Minnesota%2055332&units=f"
    
  • How to see the tablespaces created with DBCA

    Dear,
    I have my db created with dbca, how can I see my table space and temporary table space should I use to install my apex.

    THX adavance.
    Celio

    Hello

    If you have created your default database without any specification with DBCA you probably
    have the tablespaces after (if you're 10g or 11g):

    SYSTEM
    SYSAUX
    UNDOTBS1
    USERS
    TEMP

    TEMP is normally your Temporary Tablespace and USER a Tablespace to use for your data.

    You can check with the query given in the previous post (select tablespace_name dba_tablespaces ;) or)
    using DBConsole EM.

    Anyway, you can add your own Tablespace by executing the CREATE TABLESPACE statement.

    You can get more details on the following link:

    --> http://download.oracle.com/docs/cd/B28359_01/server.111/b28301.pdf

    Best regards
    Jean Valentine

  • Title does not appear on the book created with Photo

    I created a photo book. I did a preview I submit for printing, but the title is missing on the cover page. Why? I should send it for printing of some sort? The other pages are fine. I repeated the process of the double control system by creating a PDF file. Once again, no title. The police are white in color on a saturated background. Thank you in advance for your help!

    The title should be visible in the preview and the registered version of PDF. Do not order the book if the preview is not correct.

    As a test to create a second book wit a different theme and check, if you can see the title in the preview it. The title appear?

    If this isn't the case, create a library of photos to test and create a book there. The title appear?

    What book theme are you using? Did you change the fonts in your book?

  • Cannot change the form created with Live Cycle

    My former boss, who tragically died last year, created a form pdf through Live Cycle a few years ago. The form gives the ability of the user to add text at the bottom of this if they need. I would like to be able to modify this form, but it is not letting me. All change them, insert them, options etc. are grey. I did not Live Cycle, but I don't have Acrobat Standard. How can I remove the safety of this document so that I can change it?

    It is not a question of security. You can only modify LC forms in the

    LiveCycle Designer application.

    This app used to be bundled with Acrobat (Pro), but not more.

    You have to buy separately now.

  • Windows7 when I migrated to the Working Group at the field of the firewall has crashed. And also it does not show in the services. In the firewall rules of incoming and outgoing traffic is missing.

    In my windows7 when I migrated to the task force to the area, crashed by the firewall. And also it does not show in the services. In the firewall rules of incoming and outgoing traffic is missing.

    Hello arjunpottekkad,

    It is disheartening to know that have problems you with the firewall. As I understand it the incoming and outgoing traffic rules are missing from the firewall.

    The question you posted would be better suited in the TechNet Forums . I would recommend posting your query in the TechNet Forums. You can follow the link to your question:

    Windows 7 IT Pro category

    Answer to us if you are having problems with the Windows Firewall or any other problem of Windows, and I'd be happy to help you again and try to correct the problem as soon as possible.

    Good day!

    Hope this information helps.

  • How can I remove the banner "created with the trial version" of my video?

    Hello. I created a movie in the first 10 trial version. I have now downloaded the full version but still have a banner in the film, claiming that have been created in the trial version. How can I get rid of this? I don't want to start editing the entire movie again. Thank you

    [Left Pro for first things first... MOD]

    Hi Colin,

    It seems that you use first Elements 10. Please confirm.

    You can simply remove the preview files and everything will be fine. Go to the menu of the sequence to delete render files.

    Vinay

  • I want to be able to view the data created with filemaker pro on my muse site

    I created a site of muse and want to include a page that contains five menus drop down on that shoot a (filemaker pro preference) database. The idea being, that each drop-down list determines where the next set of data is retrieved from the database.

    I spent some time looking around and saw a lot of information about BusinessCatalyst etc but have not seen a clear and definitive answer.

    Can someone point me in the right direction?

    Thanks in advance!

    Of course, you can try the same and share how it goes. Feel free to join us if you need help for Adobe muse of related issues.

  • To access the children of the element created with PopUpManager

    My application has 2 files. The first is the application main, second component custom (Popup) used to create pop up windows. I would like to know how can I access ViewStack (id a attributed to 'vs') element in the popup from the main application.

    MBB a lot of code has been removed for readability.

    application. MXML

    <s:Application creationComplete="init()">
         <fx:Script>
              <![CDATA[
                        public function init():void{
                             var popup:TitleWindow = PopUpManager.createPopUp(this , Popup , false) as TitleWindow;
                             trace(popup.vs , "It's not working!!");
                        }
              ]]>
         </fx:Script>
    </s:Application>
    

    Popup.MXML

    <s:TitleWindow>
         <mx:ViewStack id="vs">
         </mx:ViewStack>
    </s:TitleWindow>
    
    
                        
    

    Can you please try the above.

Maybe you are looking for

  • No pointing device

    Is a way to disable permanently peripheral pointing even after reboot? Thank you

  • programmatic i/o with 9205 variables

    I use the variable nodes I/O provided by NOR. I use them to dynamically read/write to a cRIO. My problem is that my series nodule 9205 values c is not very accurate. He'll jump at the level that I expect a lower value periodically. I back it up e/s v

  • Intensity background xy graph is possible?

    Hi, I am trying to display the graphic background color in respect to the value of the amplitude. The black plot mark background color. Is this possible in XY graph or any way to do it? Kind regards.

  • Need to remove the VirTool:Win32/obfuscator.AFX virus / Obfuscator.XG on Windows Vista

    Original title: VirTool:Win32/obfuscator.AFX / Obfuscator.XG virus was detected on my computer and I can't remove it after several different scans. Help, please Hi the following virus on my computer. I tried several scans with no luck.  Please help:

  • Variables back to the screens passage

    import net.rim.device.api.ui.UiApplication; class Startup extends UiApplication { String name; ViewScreen _vs; private Startup() { name = "initial value"; ViewScreen _vs = new ViewScreen(name); pushScreen(_vs); } public void setName(String n3) { name