Need help with query for points and polygons, 2 tables of

Hi all

I'm slowly stumbling along trying to figure things out space.

I have two tables, GEO_POINTS:
(
DEP_ID NUMBER (12) NOT NULL,
LINE NUMBER 4 NOT NULL,.
MDSYS. POINT_LOC SDO_GEOMETRY
)

and POLYGON_AREAS:
(
POLY_NAME VARCHAR2 (120 CHAR),
POLY_DESC VARCHAR2 (120 CHAR),
MDSYS POLY_POINTS. SDO_GEOMETRY
)

Neither table is engraved in stone, if any, I can change some structure.

I'm trying to understand how to write a query to retrieve all the points in a polygon, perhaps even with an optional buffer provided by the user.

Conversely, I would probably also need to know what polygons a point would have drawn in, and it's the only request I could make any progress on.

What I have so far, which is not working properly, is the following:

Select * from deposits_search where dep_id in)
SELECT dep_id
OF geo_points, polygon_areas
where (sdo_relate)
poly_points,
(SELECT point_loc
OF geo_points
WHERE dep_id = 10282444),
("mask = ANYINTERACT") = "TRUE");

In the light of the foregoing, I want to select all the lines of a third table (DEPOSITS_SEARCH), for all polygons which is a point. The DEP_ID column is my primary key for most of the data tables in the database, and the number rose in my application query. However, the above returns all rows. It should only return one, because I only have a polygon of test defined so far.

Any help is greatly appreciated. Thank you

Bill Ferguson

in which case you must include a line of buffer for the interaction between the points and polygons (with a stamp),

better, you use the SDO_WITHIN_DISTANCE operator.

http://download.Oracle.com/docs/HTML/B14255_01/sdo_operat.htm#i77653

Not so sure what you mean with "I always have problems while providing a point location and extract the polygons that point would be plotted in" as so-called before unless you want that as a 'transitional instance of a geometry. (Specified using a variable binding or a builder SDO_GEOMETRY.) »

http://download.Oracle.com/docs/HTML/B14255_01/sdo_operat.htm#i78531

Read what geometry2 means in there. Read the examples and you will see that you have the geometry second in space operator as a builder. If this is what you need.

Luke

Tags: Database

Similar Questions

  • Need help with keyframes for start and stop an effect

    I use a mask and blurred for a few seconds. I understand that I must use keyframes to indicate when to start and stop this effect in the video, so that the same area is not trimmed for video full.

    The problem is, I can't find help by correctly setting the keyframes. When I opened the menu keyframes in the effect, it seems that I must together for both the mask took and the blur effect. I did... to start and stop at specific times, but the rest indeed throughout the video, so of course miss me something by using keyframes. The manual to create effects is not useful. I need assistance with keyframes as what I'm doing is clearly not working. Help!

    If the mask does not move that you don't have to set the keyframe. For the blur, click the stopwatch next to 'bluriness' add keyframes as below, the Reds don't blur and blue those maximum blur this fade effect.

  • Need help with query SQL Inline views + Group

    Hello gurus,

    I would really appreciate your time and effort on this application. I have the following data set.

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 20.00 *---19
    1234567 11223 - 05/07/2008 - 44345563 -a--10,00---19 ofbad quality adjustment
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19

    Please ignore '-' added for clarity

    I'm writing a paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, aggregate query Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Type, Invoice_Number, Vendor_Number. When there are no more records I want to display the respective Description.

    The query should return the following data set

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 10.00 *---19
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19
    Here's my query. I'm a little lost.

    Select b., A.sequence_id, A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    de)
    Select sequence_id, check_number, check_date, invoice_number, sum (paid_amount) sum, vendor_number
    of the INVOICE
    Sequence_id group check_date, check_number, invoice_number, vendor_number
    ) A, B OF INVOICE
    where A.sequence_id = B.sequence_id


    Thank you
    Nick

    It seems that this is a duplicate thread - correct me if I am wrong in this case->

    Need help with query SQL Inline views + Group

    Kind regards.

    LOULOU.

  • Need help with query Cumulative difference

    Hi all

    I need help with a query and my requirement is as below

    {code}

    ROWNOORDERSVALUE

    110900
    211700
    312500
    413400

    {/ code}

    I have need to query which will display the cumulative difference for example I value tell 10000 numbers opening

    now I need for each of the lines of cumulative difference

    {code}

    ROWNO ORDERS DIFF

    1 10 10000 - 900 = 9100

    2 11 9100 - 700 = 8400

    3 12 8400 - 500 = 7900

    4 13 7900 - 400 = 7500

    {/ code}

    WITH commands LIKE (10 SELECT order_id, 900 double UNION ALL val
    11. SELECT, 700 FROM dual UNION ALL
    SELECT 12, 500 FROM dual UNION ALL
    Select 13, 400 double)

    SELECT row_number() over (ORDER BY order_id ASC) AS rowno
    order_id
    sum (val) 10000 - OVER (ORDER BY order_id ASC) AS diff
    orders

    /

    HTH

  • Need help with coding for HTML5 with emergency Flash video

    Hello, need help with my coding in Dreamweaver CS5.5 for HTML5 with emergency Flash video. Not sure if the coding is correct. Do I need any other JavaScript etc.?

    code.jpg

    Another thing is that you don't have to include SWF as aid manual if you provide all 3 ogv, webm & mp4 video formats as one of these formats will certainly be played in any browser that is fully compatible HTML5.

    Still one thing you could do if you don't mind hosting your video on Youtube is to get an embed code for Youtube - in this way, you don't have to convert all the files. YouTube will do it for you and it will play on devices of HTML5 as well as supports Flash player of relief for devices that cannot play HTML5.

  • Need help with query between 2 dates

    Hello

    I did not SEE in a long time and need help with a simple query.

    I have a table of DB access with 3 fields, name, date and number

    What I want is to create a query to retrieve all the names between 2 dates

    When I ask the date field, the results are showing in this formats 2013-07-12 00:00:00

    Here's my query

    < cfquery datasource = 'mydb' name = 'test' >

    SELECT name from myTable

    where edate between ' 2011-01-01 00:00:00 ' AND ' 2013-01-01 00:00:00 '

    < / cfquery >

    < cfoutput query = 'test' >

    #name #.

    < / cfoutput >

    What I get is this error

    ODBC = 22005 (assignment error) error code

    [Microsoft] [ODBC Microsoft Access driver] Type mismatch of data in the expression of the criteria.

    Don't know what I'm doing wrong here.

    Please let me know.

    Thank you

    SELECT ename

    FROM MyTable

    WHERE edate BETWEEN

    AND

    #ename #.

  • Need help with the OSB Assign and replace the

    I have a proxy service that receives the SOAP message:

    " < = xmlns:soapenv soapenv:Envelope ' http://schemas.xmlsoap.org/SOAP/envelope/ "xmlns:SOAP - ENC =" " http://schemas.xmlsoap.org/SOAP/encoding/ "container =" " http://www.w3.org/1999/XMLSchema ">

    " < = xmlns:soapenv soapenv:Header ' http://schemas.xmlsoap.org/SOAP/envelope/ ">

    < / soapenv:Header >

    < soapenv:Body >

    " < pidx:OrderChange pidx:transactionPurposeIndicator = 'Replace' xmlns:pidx = ' http://www.API.org/pidXML "xmlns =" http://www.API.org/pidXML "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance "xsi:schemaLocation="C:\shareIt\OrderChange_1-2.xsd" > ""

    ...

    < / pidx:OrderChange >

    " < = Xmlns:ocp DeliveryInformation ' http://www.digitaloilfield.com/OCP ">

    ...

    < / DeliveryInformation >

    < / soapenv:Body >

    < / soapenv:Envelope >

    I need to take the OrderChange element and place it in a SOAP body and the DeliveryInformation element and place it in the SOAP of the same SOAP message header.

    The SOAP message is then sent to a business service that makes an HTTP POST of the SOAP XML.

    I created the service of the company and he sent some data test SOAP and it works very well, but cannot create a bridge between the Proxy and the Business Service.

    In the stream of messages of Proxy I tried to do an assignment in a routing. I tried to do the following:

    1. an XQuery query transform to generate the XML SOAP just described

    2. not the entitlement where the "Expression" is the transformation and the Variable is a variable based on a schema for SOAP.

    I can see that the company is trying to be invoked, but the SOAP data does not have to be formatted or passed.

    It is the right approach or is their a better way of

    1. create the SOAP wrapped XML

    2. call the Business Service.

    Any suggestions are appreciated. I can provide more detail if necessary.

    Kind regards.

    Thank you Vlad...

    I think I'm getting in that direction now. Just do some debugging.

    Appreciate the input. I will update with final results.

    Again, your help is greatly appreciated.

    Kind regards.

  • Need help with an Export-CSV and ForEach loop

    Hi guys, I'm total NOOB in CLI so please forgive the stupid question.

    I need your expert advice for the very large environment and will award points.

    I have a working script that alerts to our logout ESXi hosts, maintenance and NotResponidng mode

    His job well, but need to send a mail to all three of our VCenters

    Current script only works for a VC at a time. How do I ForEach and always the hose of the same body CSV and HTML

    It would be nice to have an HTML and CSV output that looks like this (assuming that there are currently disconnected etc.)

    I have a set of credentials, that work on all 3 of my VC

    VC1

    Host1 disconnected

    Host2 NotResponding

    VC2

    Host3 disconnected

    Host4 NotResponding

    VC3

    No disconnected/maintemance/notresponding hosts for VC3

    Here is my current code, etc. of the hidden passwords >

    # Clear old sessions
    Disconnect VIServer VC01-confirm: $false

    # VC01 VC check for disconnection and Maintenance mode and does not
    SE connect-VIServer-Server VC01 - FakeUSer username-password FakePassword

    $Report = get-VMhost-State disconnected, maintenance, NotResponding | SELECT name, connectionstate

    # scan info to be html and give him a date stamp

    $ReportHtml = $report | ConvertTo-Html | Out-string

    # Write CSV file and give it a character of data

    $filePath = "C:\PS\Output".
    $filename = "VC01disconnectedHosts".
    $CurrentDate = get-Date
    $CurrentDate = $CurrentDate.ToString ('MM-dd-yyyy_hh-mm-ss')

    $Report | Export-Csv "C:\PS\Output\VC_$Currentdate.csv".

    # Send the info by Mail

    Send-MailMessage-to [email protected] - subject VMwareMorningcheckVC01$ CurrentDate '
    SmtpServer - mail.sanlam.co.za - from [email protected] '
    -BodyAsHtml-body $reportHtml - accessories 'C:\PS\Output\VC_$CurrentDate.csv '.

    Thank you in advance for help.

    You could use a ForEach loop through all vCenters and combine the results in a $1 report.

    Something like that

    $vCenters = "VC01","VC02","VC03"
    
    # Clear old sessionsDisconnect-VIServer $vCenters -Confirm:$false
    
    $report = @()# Check VC VC01 for Disconnects and Maintenance mode and Not Respondingforeach($vc in $vCenters){  Connect-VIServer -Server $vc -User FakeUSer -Password FakePassword
    
      $Report += (Get-VMhost -State Disconnected,Maintenance,NotResponding | Select @{N="VC";E={$vc}},name ,connectionstate)  Disconnect-VIServer $vc -Confirm:$false}
    
    # parse info to be html ,and give it date stamp
    
    $ReportHtml = ($report | ConvertTo-Html | out-String)
    
    # Write out CSV file and give it a Data Stamp
    
    $CurrentDate = Get-Date -Format 'MM-dd-yyyy_hh-mm-ss'$filename = "C:\PS\Output\DisconnectedHosts-$($CurrentDate).csv"
    
    $Report | Export-Csv -Path $filename -NoTypeInformation -UseCulture
    
    # Send info with Mail
    
    Send-MailMessage -To [email protected] -Subject VMwareMorningcheck$CurrentDate `-SmtpServer mail.sanlam.co.za -From [email protected] `-BodyAsHtml -Body $reportHtml -Attachments "C:\PS\Output\DisconnectedHosts-$($CurrentDate).csv"
    

    I added the property vCenter for each line in the report

  • Need help with search for mdb using DW in ASP.

    Hello

    I'm trying to put in place a db on a Web site search tool using mdb and dw in ASP. have THEY put in place. Tested OK. Have used ms help pages (printed some) and the DW 8 missing manual to:

    Configure and test a connection string to a database and it is fine.

    Set up to search with a single parameter and it tests OK.

    Configure the results page and it tests OK too.

    I can display the search page and the results page by using the toolbar search engine address and local host by IIS installation and this is very good.

    Unfortunately, when I test the search page and use a proper search for the db password, the results page displays very well with the titles of the table, but no data. I am highly dependent on the ease of DW and I'm not much on the code.

    I tried a lot of different things, but there are so many possibilities! I tried GET and POST. I think that the problem is either in the original report send the form data to the server, the mdb data collection or data display in the final table, although it's conjecture. It covers almost all areas. Also I don't know if "repeat" in the table may have something to do with it.

    If anyone can help me with some general ideas on how I can be able to go forward. I was at this point for about a week.

    Thank you very much in anticipation

    OK, you're text field is named "textfield", but the query string you are testing for is called "search". They must be named the same.

    " size="30">

    rsSearch__MMColParam = Request.QueryString ("search")

    I don't know why you are populating the form field with a value of query string. The value does not exist because there is no field named "search". And the sending of the form (EEG) is what creates the query string that uses the results page.

    Rename the textfield object in your 'Search' form and it should work.

  • Need help with Exchange 2010 Diag and implementation

    I NEED HELP FOR EXCHANGE 2010 DAG AND THE IMPLEMENTATION THAT CAN HELP-IM I IN THE RIGHT SUPPORT GROUP?

    Hello HectorLopez_790,

    Microsoft Communities is for consumer issues with Windows 8, Windows 7, Windows Vista and Windows XP. Your question with Exchange would be better supported in the TechNet forums.
    Click here for a link to transfer your question in the forums of Exchange.

    Thank you

    Marilyn

  • Need help with license for Windows store

    Hello! I have problem with Windows store, he says he has a problem with the license.

    It happened because I tried to upgrade my Windows 8.1 to Windows 10 and I've failed at about 20 times. Servers of M$ have been save this issue but they have not registered my fails so now servers $ M think I use illegal license for my laptop. My laptop is Asus F55A and I can not use the store because M$ servers does not allow me too.

    Please Microsoft something about it.i have legal Windows but probably your servers register this as illegal because I repeatedly upgrading to windows 10 who never worked and your servers did not know my fails.

    Please answer.

    Error with Windows store code "this application failed to start because of a problem with its license. Please try again later.

    Any help will be for me!

    Hello

    Thanks for posting your query on the Microsoft Community.

    According to the description, I understand that you are facing problems with Windows.

    I suggest you to refer to the suggestions of B Abid replied on 29 October 2012 and check if that helps.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-windows_store/unable-to-open-Windows-8-store/8a90d67e-9FEE-4B1F-A549-e702d0b207f4

    Hope that the information provided is useful. Let us know if you have questions related to Windows, we will be happy to help you.

  • Need help with drivers for Satellite P205-S6267

    I think I have all the drivers for my laptop, but I can't control the brightness of the screen or access capabilities of standby power. I downloaded tons of drivers power saver, and none of them work. Someone please help. I am running XP and the only driver I found is for Vista. I've been at this for two days... Please write to me at:

    [email protected]

    Hello

    Just FYI: whenever you need a driver download from http://www.csd.toshiba.com/cgi-bin/tais/su/su_sc_home.jsp?

    As you can see your model of laptop is not yet supported for WXP and I guess you have to wait because you need precisely designed these tools and utilities for your laptop model. In the meantime, I think you can live without brightness control option. In my opinion, it is not so important. Also try to use the Windows power saver options. I'm sure you can use them up to what Toshiba offer WXP tools and utilities.

  • With the help of MERGE for update and insert a table

    -Oracle 11 g
    -Windows 2008

    I'm working on a script which requires update on insertion according to requirement.

    I table_a in the Test database and table_b in a Production environment and want to sync database availability.
    I need help to place the dblink (where to put it etc.).
    Here's what I've got so far:

    / * Update the tables for the production of Test environment
    November 28, 2011
    */

    FUSION
    in prod.tbl_link P
    using (select * from test.tbl_link) T
    On(prod.tbl_link.link_id = test.tbl_link.link_id.ID)
    When matched then
    Update
    Set P.LINK_ID = T.L_LINK_ID,
    P.L_URL = T.L_URL =,
    P.L_TITLE = T.L_TITLE,
    P.L_DESCRIPTION = T.L_DESCRIPTION,
    P.ISSUE_DATE = T.L_ISSUE_DATE,
    P.PUBLICATION_DATE = T.L_PUBLICATION_DATE,
    P.LAST_MODIFIED_DATE = T.L_LAST_MODIFIED_DATE,
    P.L_ICON_NEW = T.L_ICON_NEW,
    P.L_ICON_RECENT = T.L_ICON_RECENT,
    P.L_ICON_NEW_FROM_DATE = T.L_ICON_NEW_FROM_DATE,
    P.L_ICON_NEW_TO_DATE = T.L_ICON_NEW_TO_DATE,
    P.L_ICON_RECENT_FROM_DATE = T.L_ICON_RECENT_FROM_DATE,
    P.L_ICON_RECENT_TO_DATE = T.L_ICON_RECENT_TO_DATE,
    P.ACTIVE_FLAG = T.ACTIVE_FLAG,
    P.MODIFIED_BY = T.MODIFIED_BY,
    P.MODIFIED_DATE = T.MODIFIED_DATE,
    P.CATEGORY_ID = T.CATEGORY_ID,
    P.SUBCATEGORY_ID = T.SUBCATEGORY_ID,
    P.SUBJECT_ID = T.SUBJECT_ID,
    P.STATUS_ID = T.STATUS_ID
    When not matched then
    Insert (P.LINK_ID,
    P.L_URL,
    P.L_TITLE,
    P.L_DESCRIPTION,
    P.L_ISSUE_DATE,
    P.L_PUBLICATION_DATE,
    P.L_LAST_MODIFIED_DATE,
    P.L_ICON_NEW,
    P.L_ICON_RECENT,
    P.L_ICON_NEW_FROM_DATE,
    P.L_ICON_NEW_TO_DATE,
    P.L_ICON_RECENT_FROM_DATE,
    P.L_ICON_RECENT_TO_DATE,
    P.ACTIVE_FLAG,
    P.MODIFIED_BY,
    P.MODIFIED_DATE,
    P.CATEGORY_ID,
    P.SUBCATEGORY_ID,
    P.SUBJECT_ID,
    P.STATUS_ID)
    values (T.LINK_ID,
    T.L_URL,
    T.L_TITLE,
    T.L_DESCRIPTION,
    T.L_ISSUE_DATE,
    T.L_PUBLICATION_DATE,
    T.L_LAST_MODIFIED_DATE,
    T.L_ICON_NEW,
    T.L_ICON_RECENT,
    T.L_ICON_NEW_FROM_DATE,
    T.L_ICON_NEW_TO_DATE,
    T.L_ICON_RECENT_FROM_DATE,
    T.L_ICON_RECENT_TO_DATE,
    T.ACTIVE_FLAG,
    T.MODIFIED_BY,
    T.MODIFIED_DATE,
    T.CATEGORY_ID,
    T.SUBCATEGORY_ID,
    T.SUBJECT_ID,
    T.STATUS_ID)

    You cannot update the same column that is used in the join.

    The error is been derived from here:
    on (t.status_id = s.status_id)
    

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:556373000346392260

  • Need help with query to get days of work there are using the calendar BOM

    RDBMS: 10.2.0.4.0
    Oracle Applications: 11.5.10.2

    I try to use the BOM existing in the EBS to calculate working days calendar, there is a report that I am train. The BOM calendar presents the working days and non-working with the weekend days and holidays listed as non-working days. The following query gives correct results, but I'm looking for two different ways to do the same without "the union. I have nothing against the "unions", but I feel that I'm missing a more elegant to get there way. The query will in Discoverer Plus 10.1.2.3, so using a statement 'By' is not supported.
    sample data
    
    calendar_code                calendar_date                 seq_num                     
    SAC-WRKDAY                   12/3/2010                     1817
    SAC-WRKDAY                   12/4/2010                                                              
    SAC-WRKDAY                   12/5/2010                                                              
    SAC-WRKDAY                   12/6/2010                     1818                                 
    SAC-WRKDAY                   12/7/2010                     1819                                 
    SAC-WRKDAY                   12/8/2010                     1820     
    SAC-WRKDAY                   12/9/2010                     1821
    SAC-WRKDAY                   12/10/2010                    1822
    SAC-WRKDAY                   12/11/2010                   
    SAC-WRKDAY                   12/12/2010
    SAC-WRKDAY                   12/13/2010                    1823             
    select calendar_code
         , calendar_date
         , seq_num
         , sum(decode(bcd.seq_num,null,0,1))over(partition by bcd.calendar_code order by bcd.calendar_date desc) workdays_ago
    from   bom.bom_calendar_dates bcd
    where  calendar_code = 'SAC-WRKDAY'     
    and    trunc(bcd.calendar_date) < trunc(sysdate)
    
    union
    
    select calendar_code
         , calendar_date
         , seq_num
         , -sum(decode(bcd.seq_num,null,0,1))over(partition by bcd.calendar_code order by bcd.calendar_date ) workdays_ago
    from   bom.bom_calendar_dates bcd
    where  calendar_code = 'SAC-WRKDAY'
    and    trunc(bcd.calendar_date) > trunc(sysdate)
    sample output
    
    calendar_code                calendar_date                 seq_num                      workdays_ago
    SAC-WRKDAY                   12/3/2010                     1817                                  3
    SAC-WRKDAY                   12/4/2010                                                           2
    SAC-WRKDAY                   12/5/2010                                                           2
    SAC-WRKDAY                   12/6/2010                     1818                                  2
    SAC-WRKDAY                   12/7/2010                     1819                                  1
    SAC-WRKDAY                   12/9/2010                     1821                                 -1
    SAC-WRKDAY                   12/10/2010                    1822                                 -2
    SAC-WRKDAY                   12/11/2010                                                         -2
    SAC-WRKDAY                   12/12/2010                                                         -2
    SAC-WRKDAY                   12/13/2010                    1823                                 -3

    Hello

    Of course, you should be able to combine these queries, something like this:

    select calendar_code
         , calendar_date
         , seq_num
         , sum ( CASE
               WHEN  bcd.seq_num IS NULL
               THEN  0
               WHEN  bcd.calendar_date < TRUNC (SYSDATE)
               THEN  1
               ELSE  -1
              END
            ) over ( partition by  bcd.calendar_code
                  ,            SIGN (SYSDATE - bcd.calendar_date)
                  order by        ABS  (SYSDATE - bcd.calendar_date)
                ) workdays_ago
    from   bom.bom_calendar_dates bcd
    where  calendar_code = 'SAC-WRKDAY'
    and    trunc(bcd.calendar_date) < trunc(sysdate)
    

    If you do not want to display some CREATE TABLE and INSERT statements for the sample data, and then I could test it.

    t_norwillo wrote:
    ... I have nothing against the "unions", but I feel that I'm missing a more elegant to get there way.

    Good thinking!
    When the two branches of the UNION query the same table, there is usually a more effective way: something that only requires a pass through the table.

  • Need help with query outputing group names

    I'm trying to find a way for groups of output headers, then all the records in each group etc header. It would be easy, except there is a key with what I want to do.

    Normally, if I have this data set (that I've ' borrowed' a site that showed the closest to what I was looking for):

    Example table:

    TABLE [number]

    (Name, NUMBER)

    Dave Bower 843-444-4444

    Dave Bower 843-555-5555

    Matthew Small 843-111-1111

    Matthew Small _843-222-2222

    Matthew Small 843-333-3333

    I could use the following code:

    < cfoutput query = "somequery" group = "name" >

    #name # < br >

    < cfoutput >

    #phonenumber # < br >

    < / cfoutput >

    < hr >

    < / cfoutput >

    And get this:

    Dave Bower

    843-444-4444.

    843-555-5555.

    -------------------

    Matthew Small

    843-111-1111.

    843-222-2222.

    843-333-3333.

    -------------------

    BUT my actual tables are not set up like that. Rather than recording of every name of every record, I would have an ID that is the foreign key to another table.

    Current table set up is as follows:

    TABLE [people]

    (ID, NAME)

    1 Dave Bower

    2 small Matthew

    TABLE [Phones]

    (PEOPLE_ID NUMBER)

    1 843-444-4444

    1 843-555-5555

    2 843-111-1111

    2 843-222-2222

    2 843-333-3333

    If this output actually would this give me with my current setup and request above code:

    1

    843-444-4444.

    843-555-5555.

    -------------------

    2

    843-111-1111.

    843-222-2222.

    843-333-3333.

    -------------------

    How can I keep my current setup but create a query that produces the same result from the top? (The table names of people like the group headers, but data from the phones table under that output)

    You must gather the two tables, and then group the output.

    Something along the lines of the (may vary slightly depending on your DB and the exact table structure)

    SELECT ppl.name, ph.number

    PEOPLE ppl

    INNER JOIN phones ph ON ppl.id = ph.people_id

    ORDER BY ppl.name

    See you soon

    Kai

Maybe you are looking for

  • Satellite L500 - 19 X does not after all liquid spill

    Hello Newbie here, pleased to meet you all.I got a Toshiba L500 19 X, who has a problem, the keyboard does not work, at all. This happened after a spillage, or so I thought.I fixed a few laptops which have been submitted to liquids, but this one is d

  • F Yoga ThinkPad keys

    Any help appreciated. I'm trying to get my F keys to act in "legacy", so I don't need to hit the "Fn" key to get the "F key" to work as ordinary F keys. Tried the Advanced BIOS boot. Don't give me the option there?

  • SUSPECTED MALWARE ROOTKIT SLOW PC

    My HP PC (Windows 7-32 bit, browser IE 10) runs slowly and often in place. I ran RogueKill on her cleaning tool, and in the process tab, it comes back with: Status [NoKill}  Type Proc.Svhost PID 9612 name svchost.exe C:\Windows\System32\svchost.exe p

  • In my address book, I have email address of a friend who displays a name attached and should not

    In my address book, I got e-mail from a friend, but there is a jennyhunny that Gibson attached to his name. I deleted his accout and put her back in, but Jennyhunny gibson is still attached. I googled jennyhunny gibson and rises as spam. How can I ge

  • How to install windows 7 on a mac with nno disc player?

    I have the new mac of the retina and need windows to install an architecture of the school program, but I don't have a disk drive. is it possible to back up windows on a USB?