How to give alias name for group of columns.

the below is the query to get Columns. But, i need to make single alias name to all the column which i get. I need to get column names also event, domain, entity, bpdid. Above columns should be under single alias name like 'baseMessage'. Please advise on this.
select (select decode(ICKD_CHR_KY1_ID,'I','New','D','Cancelled','U','Modified') from ICKD where ICKD_APLN_ID = 'CSTCOM' and ICKD_NUM_KY1_ID = 1438227010) event, 'Client' domain, 'CustomerCommunication' entity, 'General' scope, (select ICKD_NUM_KY6_ID from ICKD where ICKD_NUM_KY1_ID = 1438227010 and ICKD_APLN_ID = 'CSTCOM') bpdId from dual;

; WITH CTE AS (
    SELECT Case When  sum(b.targetTotal) > 0 then  Sum(b.targetTotal)  
                      else 0
           end as Profttarget,
           Case When  sum(a.salestotal) > 0 then  Sum(a.salestotal)  
                      else 0
           end as Sales,
           Case When  sum(a.salescost) > 0 then  Sum(a.salescost)  
                else 0
           end as SalesCost
    From  Sales A
    JOIN  Target B A.salesdate = B.salesdate
SELECT Profttarget- ( Sales - SalesCost ) as TargetRequired
FROM   CTE
This gives you a query that runs in SQL Server.
But it does not look right to me. I don't know what the keys of these tables are, but is it really salesdate in both? And even if it is, the join still looks strange.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • How to give dynamic name for csv export files?

    Hi,
    how we can give dynamic file name for each csv export file? ex(&item_name.csv)
    I am using apex 4.1 and IE 6,
    thanks in advance
    regards
    Chandran

    Please help me on this
    I am using report template as a csv export..
    when user click on download link on other page he will redirect to csv export temlate page and he is is directly get the open or save window
    but dynamic title name is not working for only for this.
    regards
    Chandran

  • How to set Alias name for URL or change  URL..

    Hi:
    I am using Apache Tomcat as web server, it contains multiple web applications.
    Url for one of this application is, e.g. http://localhost:8080/myapplication. This particular url work fine.
    But i want to use only mypage word instead of all the above url.
    So how to set or map this?
    Thank You,
    Anup Desai.

    Thank you.
    I tried to set the displayname (using setPersonal function)
    Still its not working.
    I feel it is because during authentication we give the login name (which is taken as the display name).
    Is there any way to change without touching configuration level properties in exchange server 2007.
    thanks in advance

  • Hi guru's i want to dovelope smart form how can we give form name for sales

    hi guru's i want to dovelope smart form how can we give form name for sales order  plz help me  ...

    Hi,
    If u want to assign the form to Standard sales order, The, this form in the NACE.
    and the, Run from va02/03.
    Reward Points,
    Vamsi.

  • How can we give two name for a single material ??

    Hi friends
    how can we give two name for a single material ??
    e.g.. if single material is sold to different customer by different names
    then how can we do that ??

    Yes
    you can achieve it thro CMIR in T code VD51
    Go to T code VD51 choose that customer and material combination and click on to its details blue lens on application tool bar
    In the screen which is coming ,enter your description in the CUSTOMER DESCRIPTION tab the second one and save
    Now create a sales order and see
    Your requirement will be fulfilled
    If a material is pen description is ball pen in material master and for customer A you have defined it as Pen 1 and description as Super ball pen in VD51
    If a material is pen description is ball pen in material master and for customer B  you have defined it as Pen 1 and description as  VerySuper ball pen in VD51
    Now in sales order the description will appear as Super ball pen for Customer A
    Now in sales order the description will appear as Very Super ball pen for Customer B
    Hence the material pen whose description is ball pen in MMR will appear as super ball pen for customer A and very super ball pen for customer B
    Hope you have checked the field info record in VOV8
    I have tried this tested this and getting it
    Regards
    Raja
    Edited by: ramanathan raja on Dec 8, 2008 5:54 PM

  • How to give error message for the screen element text field when wrong i/p

    How to give error message for the screen element text field when wrong i/p
    when wrong input given
    eg. 
    I have a text box with SBOOK-CARRID
    so when user give wrong entry in text box i.e LG
    then I should give some error stating that the the input is invalid or not available ,
    now it showing the error of standard messages,
    i want manual message to be displayed when error comes.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    Hi all,
    Thank you for your valuable reply,
    but the thing is that its a screen field,
    i.e text box not a selection screen
    i created in screen layout
    with name sbook-carrid
    now i want to get error message display if wrong i/p is given
    thank you.
    Regards,
    Jagrut bharatkumar Shukla,

  • How to specify alias name in system property while making 2way SSL con ?

    Hi All,
    I am tring to run a java client with 2way SSL which uses CAC card as keystore for the client. I have addded the following system property in my client program to make it work and change the java.security file to add pcks11 provider.
    System.setProperty("javax.net.ssl.keyStoreType", "pkcs11");
    System.setProperty("javax.net.debug", "ssl");
    The program works fine and handshake is successfully done . But the problem is when i have more than one trusted certificate in the CAC card, it take a default certificate. I want to specify the certificate that should be used to do the client auth maybe specify the alias name . I didnt find any system property to do so.
    Please let me know how to specify alias name as system property so that the 2way SSL used the specified alias for the client auth or is there any other way to specify the alias name. As in case i acccess the server URL from any browser i get a certificate selection prompt and the connection is established with the selected certificate.
    Thanks in advanced,
    Ruhul

    I didn't find any system property to do so.There isn't one.
    Please let me know how to specify alias name as system propertyYou can't.
    You would have to write a custom KeyManager. See the JSSE Reference Guide.

  • How to get alias name of stored certificate from iKey token 2032

    Hi All,
    Below is my code woks well to use the same keypair for both encrypt/decryprt-SunPKCS#11 in SDK1.5. In my code i hard coded alias name of certificate, kindly tell me how to read alias name of certificate from iKey token 2032??
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.sql.*;
    import java.text.*;
    import java.math.*;
    import java.security.*;
    import java.security.cert.*;
    import java.security.interfaces.*;
    import javax.crypto.interfaces.*;
    import javax.net.ssl.*;
    import javax.crypto.*;
    import javax.crypto.spec.DESKeySpec;
    import java.security.KeyStore.*;
    public class Encrypt
    public Encrypt(){}
    public void loginToken() {
    Provider p = new sun.security.pkcs11.SunPKCS11(MQConfig.getvalue("SecurityPropertyPath"));
    String myAlias = "349eefd1-845b-4ba4-9f88-06e9f5cb82f6";
    /** to view alias name
    keytool -list -v -keystore NONE -storetype PKCS11 -storepass PASSWORD
    Security.addProvider(p);
    KeyStore ks = null;
    PrivateKey privKey = null;
    PublicKey pubKey = null;
    try{
    String password = General.ReadFiles(MQConfig.getvalue("logFilePath"),"Simple");
    password = password.trim();
    char pin[] = password.toCharArray();
    ks = KeyStore.getInstance("pkcs11");
    ks.load(null,pin);
    java.security.cert.Certificate cert = ks.getCertificate(myAlias);
    Key key = ks.getKey(myAlias, pin);
    if(PrivateKey.class.isInstance(key)) {
    privKey = (PrivateKey)key;
    pubKey = cert.getPublicKey();
    FileInputStream in = new FileInputStream("C:\\ReportDBBE.properties");
    FileOutputStream out = new FileOutputStream("C:\\ReportDBAE.properties");
    Cipher cp=Cipher.getInstance("RSA/ECB/PKCS1Padding", p);
    cp.init(cp.ENCRYPT_MODE,pubKey);
    CipherOutputStream cout=new CipherOutputStream(out,cp);
    byte[] input=new byte[8];
    int byteread=in.read(input);
    while(byteread!=-1){
    cout.write(input,0,byteread);
    byteread=in.read(input);
    cout.flush();
    in.close();
    cout.close();
    catch(NoSuchAlgorithmException nsae)
    System.out.println("No Such Algorithm Exception " + nsae.getMessage());
    catch(NoSuchPaddingException nspe)
    System.out.println("No Such Padding Exception " + nspe.getMessage());
    catch(InvalidKeyException ike)
    System.out.println("Invalid Key Exception " + ike.getMessage());
    ike.printStackTrace();
    catch(IllegalStateException ise)
    System.out.println("Illegal State Exception " + ise.getMessage());
    catch(KeyStoreException kse)
    System.out.println("Key Store Exception " + kse.getMessage());
    catch(CertificateException ce)
    System.out.println("Certificate Exception " + ce.getMessage());
    catch(IOException ioe)
    System.out.println("IO Exception " + ioe.getMessage());
    catch(UnrecoverableKeyException unrke)
    System.out.println("Unrecoverable Key Exception " + unrke.getMessage());
    public static void main (String args[]) throws Exception {
    try{
    Encrypt tl = new Encrypt();
    tl.loginToken();
    }catch(Exception e){
    e.printStackTrace();
    Your help is very much appreciated!!!!

    Hi All,
    Now i managed to get alias name.
              char pin[] = password.toCharArray();
              ks = KeyStore.getInstance("pkcs11");
              ks.load(null,pin);
    Enumeration ea = ks.aliases();
              while(ea.hasMoreElements()) {
              myAlias = (String)ea.nextElement();
              }

  • How to use Alias name in OData service in SAP HANA

    Hi,
         I need to change one column name with alias of another name in odata service definition or odata url running in rest client. I am trying to give alias name with as key in the service definition like sql query.
    ex:
    There is one table with column name of PRODUCT_ID. I exporting that table via odata service to SAP UI. In the UI i dont want the product id column as PRODUCT_ID. It should be ike "Prodcut". Like we are using in SQL example
    select "PRODUCT_ID" as "Product" from "producttab";
    But i can't use as key for alias name. So i am getting syntax error.
    I have tried in rest client also ie executing odata file in rest based service. But i got error only.
    If anyone knows about this alias name in odata service, Please help me to resolve this issue..

    Hi Thomas
         Thanks for your reply.
         Actually in odata service definition i am using attribute and calculation views only. But in some case from the model view itself i need to use some alias names to the UI through odata service.
         For example in attribute view i have some columns with name col1,col2... I am getting those columns in UI using  odata service, for particular col2 column i need to change column name as product. And i am using the same view as source of another odata service in that service i need to change that column name as productname.
         In that case i need alias name usage. So that only i am searching alias keyword in odata service.
         Is there any possibility to use alias names in odata service.

  • LDAP OID Distinguished Name for Groups

    Hi, Can I use another "Distinguished Name for Groups" in LDAP (OID) configurazion in BIP Admin?
    Watching the user guide http://download.oracle.com/docs/cd/B40078_02/doc/bi.1013/b40017/T421739T475591.htm#T434695
    Distinguished Name for Groups
    For example: cn=Groups, dc=us,dc=oracle,dc=com
    The default value is cn=OracleDefaultDomain,cn=OracleDBSecurity,cn=Products,cn=OracleContext,dc=example,dc=com
    If a try to use the dn cn=RoleNames,cn=SIM,dc=example (instead of "example" I use the real name of dc), LDAP integration doesn't function.
    Do you know why?
    Thank you,
    R.

    Hi
    We're facing a similar issue in our environment in that users authenticate with their SAMAccount names, which are FirstInitial+Lastname, eg. jdoe (John Doe). LDAP requires us to use the full DN name in certain domains (not all) to login, which is rather irritating.
    There are several domains. In windows we all login with the samaccount name, which follows the same principle for everyone. So DomainXYZ\jdoe .
    In LDAP though, it appears that for DomainABC it needs CN=John Doe, whereas for DomainXYZ it will accept CN=jdoe etc.
    Would you mind elaborating on how you managed to search LDAP for your purposes? I hope to get some insights in how to use the package dbms_ldap, because I'm rather new to APEX and with a growing userbase I'd like to move away from Apex user accounts.
    Thank you
    Tom

  • Alias name for the column name in Prompt

    Hi,
    I have a scenario where I am taking column names into prompt. I have used the following SQL in the SQL results under "Show" option of the Prompt.
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By OrderDate"' END FROM " Real Time"
    UNION ALL
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By ShipDate"' END FROM "Real Time"
    My problem here is I am getting the column names into the Prompt as "Orders"."By OrderDate" and "Orders"."By ShipDate", which is not acceptable and readable for mat for the user. Is there any way that I can assign an alias name for the column name such as OrderDate and ShipDate in the above SQL.
    Your quick respose is appreciated.
    Thanks,
    Rama

    hi,
    try an alternative one....in your administrator make new columns with alias to ones you want...so you wiil be able to show whatever you want.
    Otherwise,is it possible to show
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By OrderDate"' as "xxxxxxxxxxxxx"END FROM " Real Time"
    UNION ALL
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By ShipDate"' as "yyyyyyyyyyyyyyyy"END FROM "Real Time"
    Ending,you want the data from your columns?or just the name??
    hope i helped...
    http://greekoraclebi.blogspot.com/

  • How to give  Value set for model attribute?

    Hi all,
           How to give value set for model attribute?
           plz explain me with some sample code.
    Regards,
    Srinu

    Hi Srinivasulu,
    An attribute (of basic data types like integer , string etc) holds a single values.
    Please clarify by what you mean value set ?
    Also, share the structure of context.
    Regards,
    Kartikaye

  • How to give JNDI name

    Hi,
    Can you please tell that where we have to give JNDI name for a client,while using EJB.
    Thanks.

    JNDI name is specified in the orion-ejb-jar.xml.
    http://download-east.oracle.com/docs/cd/B25221_04/web.1013/b19177/orionejb002.htm

  • HOW TO GIVE EXTERNAL NUMBER FOR ORG UNIT

    HOW TO GIVE EXTERNAL NUMBER FOR ORG UNIT
    Regards,
    Kumar

    HAI..
    External number assignment
    If you want the user to assign the numbers, enter "EX" in the 'NR' field. The number ranges are then indicated by the letters "EX".
    Number assignment for plan version 10 / object type S: Subgroup 10S

  • How to fine query name for given transaction

    how to find query name for given transaction

    Check out the related thread
    https://forums.sdn.sap.com/click.jspa?searchID=1491773&messageID=959848
    Use T/code SQ01 to find query. after this transaction select client specific Query areas via
    Menubar>Environment>QueryAreas--> Select Client Specific.
    Regards,
    Santosh

Maybe you are looking for

  • Can I use 2 apple expresses with my modem?

    I have my  modem plugged into my airport express.But I want to get a better signal upstairs can I put another airport express upstairs to extended my wifi?

  • Modify Attributes for User Configuration Dumps Error

    Anyone have any ideas how to go about troubleshooting the following: When we Go to Identity System Console...User Manager Configuration...Tabs...Users and then click the "Modify Attributes" button we get the following error page: Bug Report Form An e

  • My itunes account says disabled!! how do i re-activate it??

    my itunes account says disabled!! how do i re-activate it??

  • My Mac is so **** painfully slow..:-(

    Hello, please i need your help. I am using a MacBook Pro with Mavericks installed. I bought this Mac as a used Model early 2013. At this Time Mountain Lions was installed. And it ran perfectly and it worked like a charm..:-) But... After a couple of

  • Transparent Fill Slide controls?

    I use a Numeric Fill Slide in my program to indicate the value of a particular quantity that I can set in a variety of different ways.  It occured to me that it would be pretty nifty if I could actually set the value by clicking on this indicator as