SQL to give all the descriptions of market ids present in a single row

Hi,
Table1: MARKET
Columns: maket id, market name
Table2:REGION
Columns: Region id, Region Name, market id1, market id2, market id3, market id4...... N no. of markets.
Now, i would like to have SQL statement that should give me the row as below
Region Name, Market1 Name, Market2 Name, Market3 Name, Market4 name...
Please suggest.
Thanks
Ramchander

You can use one of the following methods:
*1.* select name region,
(select name from market where id=id1) market1,
(select name from market where id=id2) market2,
from region;
*2.* select r.name region,
m1.name market1,
m2.name market2,
from region r, market m1, market m2, ... where m1.id(+)=id1 and m2.id(+)=id2 and ...;
*3.* select name region,
cursor(select name from market where id=m_id1 or id=m_id2 or ...) market from region;

Similar Messages

  • Root. how to give all the privileges to user?

    hi! im root and i want to give all the privileges to my user so he can open any program and any root folder. not in terminal (sudo gparted... for example) but i want to double click the program and open it. im using gnome. also i dont want to right click and open as admin. how can i do that?
    thanks

    jowilkin wrote:
    manolos wrote:
    eldragon wrote:
    no, no, no.....if you really want to do this...get a mac..
    there are really good reasons for these limitations in user access..
    if you want to stay away from the terminal, i think gksu should help you with that. (still need to type your password though)... if you dont like the terminal, maybe arch linux isnt the right distro for you, how about ubuntu?
    its not a solution for me but thanks! ubuntu is very simple. i want to learn from linux... not just install!
    Well, first lesson...what you want to do is a really bad idea.
    hahaha! ill stay in terminal thanks for the advice!

  • Hi I am new to Apple devices, i got a new Ipad mini and i am trying to download skype from the Istore,it asks me to review my account and if i give all the details and click on next, it come to the same page,please help

    Hi I am new to Apple devices, i got a new Ipad mini and i am trying to download skype from the Istore,it asks me to review my account and if i give all the details and click on next, it come to the same page,please help

    Oh thank you very much, i was worried after a whole day's hard work but most important that i had lost my photos, i don't understan the photo,shared and albums? I have a lot of photos in my albums that it didn't let me delete, yet i could delete a lot of others, could you explain this to me please

  • How to get he names of all the local drives that are present in hdd

    Hi ABAP Experts,
    I want to get the names of all the local drives that are present in hdd on local system using
    ABAP. Is this technically possible. If so how.
    Thanks & Regards,
    Aexandr Ciunchik

    Hi Alexandr,
    My workaround.
    REPORT zztest.
    DATA : len          TYPE i,
           off          TYPE i,
           directory    TYPE string,
           result(1).
    len = STRLEN( sy-abcde ).
    DO len TIMES.
      off = sy-index - 1.
      CONCATENATE sy-abcde+off(1) ':' INTO directory.
      CONDENSE directory NO-GAPS.
      CALL METHOD cl_gui_frontend_services=>directory_exist
        EXPORTING
          directory            = directory
        RECEIVING
          result               = result
        EXCEPTIONS
          cntl_error           = 1
          error_no_gui         = 2
          wrong_parameter      = 3
          not_supported_by_gui = 4
          OTHERS               = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF result EQ 'X'.
        WRITE : / 'Drive : ',
                  directory.
      ENDIF.
    ENDDO.
    Regards,
    AS

  • Sql Query : Sum , all the possible combination of rows in a table

    SQL Server 2008 R2
    Sample Table structure
    create table TempTable
    ID int identity,
    value int
    insert into TempTable values(6)
    insert into TempTable values(7)
    insert into TempTable values(8)
    insert into TempTable values(9)
    insert into TempTable values(10)
    I actually want something like below,
    that It returns rows such that, it has the sum of all the remaining rows , as shown below.
    I will ignore the repeated rows.
    6+7
    6+8
    6+9
    6+10
    6+7+8
    6+7+9
    6+7+10
    6+8+9
    6+8+10
    6+9+10 
    6+7+8+9
    6+7+8+9+10

    This makes no sense. What about NULLs? What about duplicate values? You have rows, so you have many combinations. We know that this set totals to 39, so there is no subset totals to half of any odd number.  19.5
    in this case. 
    None of your examples are
    even close! 
     6+7 = 13
    the remaining rows 8+9+10 = 27, so you failed! 
    Want to try again?
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • SQL to get all the characters till the first pipe operator

    I have a pipe (|) separated values list stored in a column. I just want all the characters till the first pipe.('AER' in the below example.) For that i've wrote an SQL
    SQL> select substr('AER|SPAC|EJK|KLSL',1, INSTR('AER|SPAC|EJK|KLSL','|',1,1)-1 ) FROM DUAL;
    SUBSTR('AER|SPAC|EJK|KLSL',1,INS
    AERCan this be written in a more efficient way?

    try,
    SQL> select regexp_substr('AER|SPAC|EJK|KLSL', '[^|]+' ) FROM DUAL;
    REG
    AERTwinkle

  • Report which gives all the manullay released salesorders - VKM2

    User want to run a selected date range to run a report, to lists all the sales orders that have been manually released via T-code: VKM2
    But I can not find the related display variant, or do you have any other related report ?
    Thanks
    Srikanth

    Hi,
    You dont have a standard report to see the list of sales orders which are credit released. However you can find out the same from the field VBUK-CMGST and you can find out all the sales orders whose status is C or D.
    Hope this helps

  • Is there a way to display all the image files(jpeg, png, �) present in the

    Description:
    Currently I am using �Sun Java� Wireless Toolkit 2.5 for CLDC, Beta 2 � toolkit for developing J2ME applications. I am using the �javax.microedition.amms.control.imageeffect� package(JSR 234) for adding effects like red eye, border, etc. I need to display all the images in my /res folder so that the user can select one from the list for further image processing. I used File Connection API for displaying the images from the file system's /root folder. But while trying to apply the image effects I found that I can not access the file system's /root folder through getResourceAsStream(). getResourceAsStream()could only access the /res folder . Is this correct? Is there any other way to give the InputStream to the media processor through setInput()? Is there any other alternative to getResourceAsStream()? Or Is there any direct way to access the /res folder and display all its files for the user to select?
    Here is the code that I am using for providing the input and output streams and applying the image effect to the source file �Duke.jpg� in /res folder.
    MediaProcessor mp = GlobalManager.createMediaProcessor("image/jpeg");
    mp.addMediaProcessorListener(this);
    outputStream = new ByteArrayOutputStream();
    inputStream= getClass().getResourceAsStream(�Duke.jpg�);
    mp.setInput(inputStream, MediaProcessor.UNKNOWN);
    mp.setOutput(outputStream);
    ImageTransformControl itc = ImageTransformControl) mp.getControl ("javax.microedition.amms.control.imageeffect.ImageTransformControl");
    final int border =10;
    itc.setSourceRect(itc.getSourceWidth(), 0, -itc.getSourceWidth() , itc.getSourceHeight() );
    itc.setTargetSize(itc.getSourceWidth(),itc.getSourceHeight(),0);
    itc.setEnabled(true);
    mp.start();
    mp.complete();

    you need to set resource path correct place image file resource folder is correct but there is problem so yu need put the image in resource in this way C:\WTK23\apps\Image\res\example\hello\image.gif this work
    in the code try this InputStream byteInput = getClass().getResourceAsStream("/example/hello/image.gif"); this works if you need any more help contant [email protected]

  • Displaying all the records in a tabular form on a single page

    Hello,
    After setting up a data entry page, I have hit an unexpected problem.
    The logic in my page requires that all the records in my tabular form should be displayed .
    The tabular form is based on a collection, and the user selects rows through a checkbox.
    Any reload of the page due to pagination will break the logic, as some calculation and display events occur during page load,
    based on the previous page.
    I need to display about 25 rows.
    I have changed the report attribute to display 50 rows, but it displays rows only up to the bottom of the screen,
    i.e. 11 rows.
    Unfortunately I only just added some new rows and saw this behaviour else I would not have gone that way,
    as I expected APEX to display all rows if required.
    Some help will be much appreciated.
    Regards
    Leckraj

    leckj wrote:
    Hello,
    After setting up a data entry page, I have hit an unexpected problem.
    The logic in my page requires that all the records in my tabular form should be displayed .
    The tabular form is based on a collection, and the user selects rows through a checkbox.
    Any reload of the page due to pagination will break the logic, as some calculation and display events occur during page load,
    based on the previous page.
    I need to display about 25 rows.
    I have changed the report attribute to display 50 rows, but it displays rows only up to the bottom of the screen,
    i.e. 11 rows.
    Unfortunately I only just added some new rows and saw this behaviour else I would not have gone that way,
    as I expected APEX to display all rows if required.Pagination settings are cached for the duration of the session. For this change to be instantly visible, either log out, restart the brower, and log in again, or manually re-request the page from the browser address bar, adding 'RP' in the ClearCache position in the URL.

  • How to avoid word wrap in the BW Report so that result fits in single row

    Hello Colleagues
    I have a report which shows Material number versus Revenue. In the row, material is displayed with Technical name and description.
    Here, the view of the report shows the description in single line. While, in the report, description of the report runs 3 to 4 lines though description contains 5 to 6 words (which can fit easily into single line).
    Let me know how to restrict each row descrption into single line.
    Regards,
    Ningaraju

    no answers opened new thread to make more clear

  • Creating PL/SQL Package with all the types

    CREATE OR REPLACE
    TYPE rec_type AS OBJECT (
    first_name VARCHAR2(20),
    last_name VARCHAR2(20)
    CREATE OR REPLACE
    TYPE REC_TYPE_TAB AS TABLE OF rec_type
    I am able to create the above types in oracle and used in PL/SQL packages. And like this I have somany types. I would like to if I can create a package with the types to make the life easier. Could you please tell me how to do it.
    your help is greately appreciated..
    --Krish                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    sb92075 wrote:
    TYPE add only aggravation, complexity, & should be avoidedI disagree.
    When used correctly types can be the simplest solution.
    For example when passing multiple values to a stored procedure. Avoiding the type in the below example would lead to further complexity and aggravation not lessen it.
    SQL> create or replace procedure p
      2      (
      3      p_object_list in sys.odcivarchar2list,
      4      p_result out sys_refcursor
      5      ) as
      6  begin
      7      open p_result for
      8          select owner, object_name, object_type
      9          from all_objects
    10          where object_name in
    11              (
    12              select column_value from
    13              table(p_object_list)
    14              )
    15          order by
    16              owner, object_name, object_type;
    17  end;
    18  /
    Procedure created.
    SQL> exec p(sys.odcivarchar2list('DUAL','ALL_OBJECTS'),:c)
    PL/SQL procedure successfully completed.
    SQL> print c
    OWNER                          OBJECT_NAME                    OBJECT_TYPE
    PUBLIC                         ALL_OBJECTS                    SYNONYM
    PUBLIC                         DUAL                           SYNONYM
    SYS                            ALL_OBJECTS                    VIEW
    SYS                            DUAL                           TABLE

  • Filter TOP query so that a result cannot be in the top if the column value is already present in a previous row

    Hi,
    Any help would be appreciated. I have a query that is the top(5) but I want them to be distinct on only one column value, not on the entire row. Any help would be really appreciated.
    Regards,
       Seamus

    SELECT TOP 5 [DISTINCT COLUMN], MAX([SOME OTHER COLUMN]), MAX([SOME OTHER COLUMN], MAX([SOME OTHER COLUMN])
    FROM [TABLE]
    GROUP BY [DISTINCT COLUMN]
    This will do it, but the values may display incorrectly, since it's taking the MAX value of each partition of your distinct column, so another way would be:
    ;WITH CTE AS(
    SELECT *, ROW_NUMBER() OVER(PARTITION BY [DISTINCT COLUMN] ORDER BY NEWID()) AS RN
    FROM [TABLE])
    SELECT TOP 5 [DISTINCT COLUMN], [OTHER COLUMN], [OTHER COLUMN]
    FROM CTE
    WHERE RN = 1
    Thanks.

  • How can I show all the results returned by a sql query?

    Hi guys,
    I need your help.
    Let's say I have one table: TableA. Fields of TableA are aleg, anon, apes. The following sentence can return, in general, several rows: select anon from TableA where aleg = somevalue. I'd like to show the result of column anon but no luck. If I try to show the results in a TextArea and the origin is an sql query only shows the first row value. I tried Show as: show as text (based in PLSQL) and coding an anonymous plsql block as
    DECLARE
    v_anon TableA.anon%TYPE;
    CURSOR v_cur IS
         select anon from TableA where aleg = somevalue;
    BEGIN
    OPEN v_cur;
    LOOP
    FETCH v_cur INTO v_anon;
    EXIT WHEN v_cur%NOTFOUND;
    :FIELD_IN_FORM := v_anon;
    END LOOP;
    CLOSE v_cur;
    END;
    but in this case it's not shown any result.
    So the first question is what kind of field should I use to show the result. And the second one is what can I do to being able to show all the results returned by the query (provided that is more than one single row).
    regards

    Hi Denes,
    Just starting with apex. I think I know how to show the results in a report region. I've simplified the posted question.
    A more detailed question would be: Suppose you have a region where you have put several text areas to accommodate the result of a multi-column query (lets say for TableA) that only returns one row, each column value returned put in a different text area. Also you want to show the values of other fields in TableB that depends on some value just retrieved from TableA and that you want all values retrieved (from TableA and the linked TableB) to be show in the same region. Is that possible? If yes, how?
    Thank you in advance

  • Looking for a SQL query to get all the possible Alert Messages from the Rules in a Management Pack

    For reporting, I'm looking to get a SQL query of all the possible Alert Messages for Rules configured in a Management Pack (not necessarily the ones that have thrown alerts).  I can do this for Monitors, but not for Rules. 
    The configured alert messages for the Management Pack Monitors
    go like this:  ManagementPack > MonitorView> RuleModule > RuleModule.Alert Message > Localized Text
    The configured alert messages for the Management Pack Rules
    should go something like this, but there is a missing link:  ManagementPack > RuleView > RuleModule > ? Missing Link ? > Localized Text
    The Rules are tied to the Module, but I don't see a connection from the RulesModule to the Alert Message that I see in the LocalizedText. The Rule names do not always equal the Alert name. 
    Can someone provide the missing link?

    Hi,
    please try below powershell code to find the corresponding management pack for specific alert:
    $Alert = get-scomalert | where {$_.Name -like 'Agent Proxy Not Enabled*'} | select -first 1
    If ($alert.IsMonitorAlert -eq "True") {
    write-host "Ths is a monitor-generated alert"
    get-scommonitor -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
    else
    write-host "This is a rule-generated alert"
    get-scomrule -ID $Alert.MonitoringRuleID | select Enabled, DisplayName, ManagementPack
    In addition, please also refer to the below link:
    http://blogs.technet.com/b/mazenahmed/archive/2011/12/02/using-powershell-to-map-opsmgr-active-alert-to-its-corresponding-rule-monitor-and-management-pack-name.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • Periodic Alert-How to send all the records returned from the SQL in a mail?

    Hello all,
    I have defined a Periodic Alert, my SQL query returns more than one record whenever I run it. I also defined an action to send an email with the message consisting of the output variables from the SQL. Whenever i run this alert, a mail is being sent for every single record returned from the query. But i want to send a single mail containing all the records information that my SQL query returns.
    For Example: My SQL query lists all the users created on current date.
    Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
    from fnd_users where trunc(creation_date) = trunc(sysdate)
    Now i want to send a mail with all the users information from the above query, to SYSADMIN. How can this be achieved?
    Thanks & Regards
    chakoo

    Hi Chakoo,
    If the Periodic Alert is not working as requried. You can write a simple package with 3 procedures to implement the writing output to a out file and simultaneuosly send email to multiple receiptents.
    Example:
    Create Package xx_pac
    Create public Procedure P1
    begin
    Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
    from fnd_users where trunc(creation_date) = trunc(sysdate)
    fnd_file.put_line (fnd_file.output, &OUTPUT1, &OUTPUT2);
    end;
    (Create private Procedure P2
    begin
    ---Write the email package using the UTL_SMTP approch. Using this approch you can send the procedure P1 output file as an attachment to the desiginated receiptents.
    end;
    (Create public Procedure P3
    begin
    ---call the procedure P1 using the "g_request_id = fnd_request.submit_request"
    ---Wait for the above procedure to complete using "l_conc_status := fnd_concurrent.wait_for_request" procedure.
    ---call the procedure P2. (When called you must provide the correct to, from address)
    end;
    end;
    Register the Package xx_pac as a concurrent program and schedule when submit it from the request.
    Regards
    Arun Rathod

Maybe you are looking for

  • Trying to link VC++ and CVI

    I have a VC++ application that uses CVI components. It links fine when VC++ is in debug mode, but when I change to Release mode I get link errors. C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\mbstring.h(117) : error C2375: 'CVI__mbsbtype' :

  • Problem in dynamic selection screen

    Hi, I have a parameter P1 on the selection screen.When i am entering some value in that field some more field should be displayed below it on the selection screen.For ex. when i am entering 1  P2,P3,P4 should come.Whe i am entering 2  P3,P4,P5 should

  • Web Services URI - How do we find it?

    Hi gurus What is Web Services URI? How does the link look like? Can someone navigate me after going in Web Services Navigator in http://<Server Name>:<Port Number>/index.html You need web services URI when you create connectors, fill  the Parameters

  • DateFormat is not sensitive to Windows locale setting

    Hi all, The DateFormat is not sensitive to Windows locale setting, that's why this piece doesn't work correclty. This bugs is already know (#4514389) SimpleDateFormat dateFormat; dateFormat=((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHO

  • I cannot print the jewel case artwork?

    I recently downloaded 11.0.2 version of iTunes, and now I can not print cd artwork for jewel cases.  Anyone else have this problem? Anyone know how to solve it?  I have a Lexmark printer and it works outside of iTunes.