How to display a db record with a variable number of joined records

I'm building a website for an airshow http://www.hollisterairshow.com and the organiser would like to post a list of things he needs for the show and have people respond via the website. For example, he might need 20 tents and potentially up to 20 people could respond, each offering one tent, or fewer people could each offer several tents. I'd like to create a view showing the item needed and underneath it one row for each offer he receives. I already have a couple of tables defined, one called "needs" and the other called "offers" , the "offers" table has a column called "needId" which is the index from the needs table.
So far I have created a recordset to join the tables but each row contains the need and the offer so I'm seeing the need repeated on each row and I only want to see it once. Here's the SQL generated by DW CS4
SELECT needs.needId, needs.title, needs.`description`, needs.quantity, needs.needMet, offers.needId, offers.offerId, offers.name, offers.email, offers.phone, offers.quantity, offers.`comment`
FROM needs, offers
WHERE needs.needId = offers.needId
ORDER BY needs.title
I'm sure there must be a simple solution to this but I'm unable to figure it out. I'm new to SQL and doing this as a volunteer for the airshow.
Thanks,
Tony

Thanks so much, for pointing this out. This looks like it'll do what I need. I think I understand the code so I'll modify it and try it.
It looks like it will create an output that looks something like this
Need1    Offer 1
             Offer 2
             Offer 3
Need 2     Offer 1
               Offer 2
etc....
This is certainly workable. Ideally I'd like to create something like this
Need 1
     Offer 1
     Offer 2
     Offer 3
Need 2
     Offer 1
     Offer 2
Is there a way to do this? Would I need a different recordset or am I still looking at a layout issue?
Thanks again for the help.
Tony

Similar Messages

  • How do I submit to procedure with a variable number of controls in portlet?

    I need to submit to a stored procedure but my portlet has a variable number of controls. How do I do this?
    In the past I have always had an input parameter for each control. In this case the number of controls vary at runtime. Is there a way to submit to a procedure that takes some type of array of controls as an input parameter.
    Don

    Another way to do this is to apply a gradient for the background of your block.
    If you place the blue at 40% and the white at the same percentage, the transition is abrupt and looks like what you need.
    Here is an exemple, where the cyan marker is hidden behind the white one in the gradient.
    Of course, if you use something like that, you must have one object style for each height as the bar will move with the frame.
    emmanuel

  • How to display the message along with a value using BBP_CHECK_BADI

    Hi Gurus,
    I need to display a message dynamically when the user create's a shopping cart. I am using Check_badi for this. i.e., I need to display the buyer number and amount left for him dynamically. I am storing both of them in variables and don't know how to display the messages laong with some message " the amount left for <XXXXXX> is <$$$$$$$$>". Can you help me out.
    Thanks,
    Neelima

    Hi,
    you can use the function module 'BBP_PD_MSG_ADD'. This is the function module normally used for the displaying the error messages in SRM.
    See wether you can use already available error messages , use the transaction SE91 , and the message class being BBP_PD

  • How to display the selection screen with icons as well as with text element

    How to display the selection screen with icons as well as with texts (written in text elements) for PlantDate, OrderType,WareHouse..

    Report zex33.
    type-pools: icon.
    selection-screen begin of line.
    selection-screen comment 1(20) text_001.
    parameters: p_werks type marc-werks.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_002.
    parameters: p_whouse(10).
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_003.
    parameters: p_auart like vbak-auart.
    selection-screen end of line.
    initialization.
      write ICON_PLANT  as icon to text_001.
    concatenate text_001 text-001 into text_001 separated by space.
      write ICON_WAREHOUSE  as icon to text_002.
    concatenate text_002 text-002 into text_002 separated by space.
      write ICON_ORDER  as icon to text_003.
    concatenate text_003 text-003 into text_003 separated by space.

  • How can I make the popup with empty fileds and create new record?

    I would like to use a popup to create new record.
    I created a af:popup by drag and drop a VO from data control to jsff. then, I created a button and place a af:showPopupBehavior. I was able to popup window by click the button.
    however, the window filled with the information from the 1st record. and when I select a record in table and click popup, the popup is filled with that record.
    How can I make the popup with empty fileds and create new record by saving the popup?
    Thanks

    You can have edit and new buttons, in the PopupFetchEvent identify button source (using popupFetchEvent.getLaunchSourceClientId()) if new button clicked clear the binding using below code.
    If you want to see empty fields, in the popup PopupFetchEvent clear the input component bindings.
    resetBindingValue("#{bindings.<componentid>.inputValue}", null);
        public static void resetBindingValue(String expression, Object newValue) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            Application app = ctx.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = ctx.getELContext();
            ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
            Class bindClass = valueExp.getType(elContext);
            valueExp.setValue(elContext,newValue);
        }

  • How to display a Math symbol with Subscript(like  "Xad", make the "ad" be Subscript )

    How to display a Math symbol with Subscript(like  "Xad", make the "ad" be Subscript )
    I need to show "Xad"(ad is Subscript )
    I try to find the letter subscript......but ,Unicode set is not have.....
    I try to use  X<sub>ad</sub>   show it  whit Text.htmlText,   but is not used,   I think Flex's HTML is  not support the <sub> mark.
    can you tell me , how to display a Math symbol with Subscript(like  "Xad", make the "ad" be Subscript )
    thank you very much.....

    http://blog.ggshow.com/index.php/how_to_use_subscript_aamp_superscript_in?blog=11
    http://jasonbejot.com/superscript-and-subscript-in-actionscript
    and thank you very very muck

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • How can I track my mac with a serial number

    How do I track my mac with a serial number.  My computer was stolen and the find my mac wasn't enabled?

    You can't.
    What To Do If Your iDevice or Computer Is Lost Or Stolen
    iPhone, iPod Touch, and iPad
    If you activated Find My Phone before it was lost or stolen, you can track it only if it is connected to the Internet by Wi-Fi or cellular. What you cannot do is track your device using a serial number or other identifying number. You cannot expect Apple or anyone else to find your device for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty.
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should have done in advance - before you lost it or it was stolen - and some things to do after the fact. Here are some suggestions:
    This link, Re: Help! I misplaced / lost my iPhone 5 today morning in delta Chelsea hotel downtown an I am not able to track it. Please help!, has some good advice regarding your options when your iDevice is lost or stolen.
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T. Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. iCloud- Use Lost Mode
      6. What to do if your iOS device is lost or stolen
      7. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      8. Find My iPhone
      9. Report Stolen iPad | Stolen Lost Found Online
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on iCloud
      3. OS X Lion/Mountain Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)
    Mac Computer
           Find My Mac can be used from Find My Phone at iCloud.com and via Find
           My Phone on your iDevice.
          The following is third-party anti-theft software:
               1.  STEM 2.1
               2.  MacPhoneHome 3.5
               3.  MacTrack 7.5.0
               4.  VUWER 1.7
               5.  Sneaky Bastar* 0.2.0
               6.  Undercover 5.1.1
               7.  LoJack for Laptops
               8. Hidden 2.0
               9. Prey 0.6.2

  • How can my IDoc create shipment with a given number

    Hi,
    I m using IDoc type SHPMNT03, message type SHPMNT and precess code SHPM to create shipment document via EDI.
    How can I generate a shippment with a specific number and not with the number genetrated automatically??
    thx in advance.

    I think it s possible, because I ve already done the same with reservations, I created reservations with my own numbers...

  • HT1349 how can you track you ipod with only serial number ]

    2nd Generation ipod Touch

    Hello, Tommyty,
    I am sorry you have lost your iPod.  You don't yet seem to understand that its serial number is not tracked electronically.  Here is my attempt at explaining the same thing that Limnos and stevejobsfan0123 have already told you. 
    Tommytj wrote: ... HT1349 how can you track you ipod with only serial number ] ...
    Only by physically looking at the iPod's serial number.
    Tommytj wrote: i need to find my ipod can anyone help me find a way to track my ipd touch with only a serial number using icloud.
    No.
    Nobody can help you with that request because iCloud and  "Find My iPod touch" do not work that way.
    If you cannot see the iPod, you cannot track its serial number.  Unless someone sees the serial number, nobody can track it.
    Regardless of whether you have properly installed and enabled "Find My iPod touch", iCloud does not track your iPod's serial number.  This is true even when you or someone else can see your iPod's serial number.
    Regardless of how much you wish iCloud could track your iPod's serial number, it cannot.
    "Find My iPod touch" can sometimes track an iPod's location but only under the specific circumstances Limnos has already explained to you. 
    If "Find My iPod touch" cannot locate your iPod by its location, there is no iCloud way to find it.  In that case, the only way to identify your missing iPod is for you or someone else to physically look at it.
    Perhaps you will be successful with one of these alternative possibilities for recovering your iPod:
      • you can physically search and find your misplaced iPod
      • someone may it returned in response to a reward that you offer
      • the police may find it after you have reported it stolen
    Message was edited by: EZ Jim
    Mac OSX 10.7.4

  • How can I blur a image with two variables : degree and radius?

    how can I blur a image with two variables : degree and radius?
    a lot of thanks !

    What are the values of these variables supposed to represent?

  • How to display first 5 rows with a specific filter

    Hi All,
    Please do have a look at the below mentioned query.
    select * from emp where empnm like 'B%';Now suppose it will display 10 rows. But I want to display first 5 rows out of them.
    How can I do that? I tried this with rownum and rowid. It worked because the records are in order,
    but if those records are in arbitrary order, now what? What should be done here?
    Regards,
    BS2012.

    BS2012 wrote:
    Hi All,
    Please do have a look at the below mentioned query.
    select * from emp where empnm like 'B%';Now suppose it will display 10 rows. But I want to display first 5 rows out of them.
    How can I do that? I tried this with rownum and rowid. It worked because the records are in order,
    but if those records are in arbitrary order, now what? What should be done here?
    Regards,
    BS2012.This will display the first 5 records no matter of the order
    select * from emp where empnm like 'B%'
    and rownum <=5;This will display the first 5 records after ordering them
    select * from (select * from emp where empnm like 'B%' order by empnm) where rownum <=5 ;Regards.
    Al
    Edited by: Alberto Faenza on Oct 11, 2012 5:49 PM
    Edited by: Alberto Faenza on Oct 11, 2012 5:50 PM

  • How to display the info visually with the help of data present in the DB

    I need to reserve a resource for a particular period of time,When i finished in
    specify the date & time (ie start time and end time).
    I need to give a report for the particular day by displaying the timing details visually( ie by shading the cell) in the table formatt
    for example if I enter the resource name as printer and mention the start time (6:00)and end time(7:00)
    Based on the specified time(ie start time and end time) for the particular resource which are present in the Database, The displaying table's cell
    (the table that contains time in x axis,resource name in y-axis & each cell represent 1/2 hour )should be shaded. (ie 6:00 to 6:30 & 6:30 to 7:00 cells are to be shaded)
    hope u understand my problem
    Plz help me in this regards....
    Thank u in advance

    Hi,
    to display the header first append the header as the first record and then append your data.
    to remove comma seperator use the following code:
    replace all occurences of ',' with space.
    then condense.
    and last u can download data to presentation and application servers at the same time using 'gui_download'  and  datasets.
    Thanks & Regards,
    Sudheer.

  • How to display double byte characters with system.out.print?

    Hi, I'm a newbie java programmer having trouble to utilize java locale with system io on dos console mode.
    Platform is winxp, jvm1.5,
    File structure is:
    C:\myProg <-root
    C:\myProg\test <-package
    C:\myProg\test\Run.java
    C:\myProg\test\MessageBundle.properties <- default properties
    C:\myProg\test\MessageBundle_zh_HK.properties <- localed properties (written in notepad and save as Unicode, window notepad contains BOM)
    inside MessageBundle.properties:
    test = Hello
    inside Message_zh_HK.properties:
    test = &#21890; //hello in big5 encoding
    run.java:
    package test;
    import java.util.*;
    public class Run{
      public static void main(String[] args){
        Locale locale = new Locale("zh","HK");
        ResourceBundle resource =
            ResourceBundle.getbundle("test.MessageBundle", locale);
        System.out.println(resource.getString("test"));
      }//main
    }//classwhen run this program, it'll kept diplay "hello" instead of the encoded character...
    then when i try run the native2ascii tool against MessageBundle_zh_HK.properties, it starts to display monster characters instead.
    Trying to figure out what I did wrong and how to display double byte characters on console.
    Thank you.
    p.s: while googling, some said dos can only can display ASCII. To demonstrate the dos console is capable of displaying double byte characters, i wrote another helloWorld in chinese using notepad with C# and compile using "csc hello.cs", sure enough, console.write in c# allowed me to display the character I was expecting. Since dos console can print double byte characters, I must be missing something important in this java program.

    after google a brunch, I learned that javac (hence java.exe) does not support BOM (byte order mark).
    I had to use a diff editor to save my text file as unicode without BOM in order for native2ascii to convert into a ascii file.
    Even the property file is in ascii format, I'm still having trouble to display those character in dos console. In fact, I just noticed I can use system.out.println to display double byte character if I embedded the character itself in java source file:
    public class Run {
         public static void main(String[] args) throws UnsupportedEncodingException{
              String msg = "&#20013;&#25991;";    //double byte character
                    try{
                    System.out.println(new String(msg.getBytes("UTF-8")) + " new string");  //this displays fine
                    catch(Exception e){}
                    Locale locale = new Locale("zh", "HK");
              ResourceBundle resource = ResourceBundle.getBundle("test.MessagesBundle", locale);
                    System.out.println(resource.getString("Hey"));      //this will display weird characterso it seems like to me that I must did something wrong in the process of creating properties file from unicode text file...

  • How to display BLOB image column with WEB application, JSF, ADF BC

    I looking for a way to display the content from a blob column on a WEB application, JSF, ADF BC
    The blob column contains a JPEG image.
    About the application
    The model contains a viewobject where the blob column attribute (photoimg) type is of type : BlobDomain
    Now I have to create the view to display the content of photoimg inside a JSF-JSP page.
    Any advice ?

    Search is your friend
    How to display the content of a BLOB column in a ADF/BC pages ?
    John

Maybe you are looking for

  • HTTP Server High Availability

    Hello All. I have a question regarding OC4J and HTTP server High Availability. I want to do something like the Figure 3-1 of the Oracle Application Server High Availability Guide 10.1.2. See this link http://download-east.oracle.com/docs/cd/B14099_11

  • 7.5.2 breaks ipv6 from lan port

    I have a slightly unorthodox ipv6 setup. Upgrading from 7.4.2 to 7.5.2 killed it. I ended up restoring my airport express base station w/802.11n to 7.4.2 to restore access. dsl modem with a public v4 /29 network hub connected to dsl modem cisco 1701

  • No keys work and can't shut computer off

    My computer just quit functioning properly tonight. The battery is charged, the screen lights up appropriately, and the mouse moves (but when I click, nothing happens It is stuck on "Mail" at the top of the screen but I can't quit by any of the usual

  • Missed calls icon on BlackBerry 8800

    Hi Everyone, I am hoping someone else has had this problem before. I have a BlackBerry 880 handset that has 6 missed calls showing on the top of the home screen, but I have cleared all of the missed call and phone logs as stated elsewhere in these fo

  • What is an EJB client?

    From EJB tutorial http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts2.html#62895 Second, because the beans--and not the clients--contain the application's business logic, the client developer can focus on the presentation of the client. The cl