Query to find no of peoples with the same age(using distinct)

query to find no of peoples with the same age(using distinct)
Edited by: swordfish3 on Mar 7, 2009 9:24 PM

it would be helpful if you posted some proper sample data with proper expected results.
The easier you make it for us to help you, the more likely you will get helped.

Similar Messages

  • Can I un-merge contacts so people with the same last name have separate entries?

    Since upgrading to iOS7 on my iPhone 4, I find that a lot of contacts were merged into single entries.  The merged contacts are people with the same address and may have same last name, but they have other contact info that differs, especially different mobile phone numbers.  Is there a way to separate such contacts so I can tell whose mobile phone number is whose?  I sync my iphone contacts with the address book on my iMac (OS 10.7.5), where each person remains a separate entry.  It is useless for me to see one entry per family on my phone when I cannot tell whose phone number is whose.  Any way to fix this?

    Select the unified contact you want to unlink
    Tap edit
    Scroll to the bottom
    Tap the red circle
    Tap the read unlink button to confirm.

  • How can i find my lose iphone with the same apple id i use now

    how can i find my lose iphone with the same apple id i use now

    If you set it up on your iPhone before you lost it then you can sign into your iCloud account on a computer and attempt to locate it.

  • Why contacts birthdays are being showed in iCloud calendar all with the same age (11 years)??

    Why contacts birthdays are being showed in iCloud calender all with the same age (11 years) ?? There is a solution to solve this problem ??
    Thank-you

    I cannot agree more with your comments! What a way to frustrate your customers!
    I have been having an issue with iCloud on Mac where it kept asking me for my password and sometimes would, sometimes would not continue to access my iCloud mail. Today it just refused to connect to iCloud mail.
    I looked in the Mail, Contacts and Calendars in my MacBook Pro settings and discovered that 2 iCloud accounts were present. One with my original Apple ID (a gmail address) and a second with my new iCloud email ( an @me.com address). Having deleted the second account, using the new @me.com address everything is working fine.
    So from my viewpoint when I moved over to iCloud I was asked to sign in with my Apple ID (the gmail address) then to create an @me.com address. However, as far as I can see all sign ins to the new @me.com account on Macbook, iPhone and iPad need to be done through the old Apple ID (the gmail address). Is that confusing and just plain crazy???
    Further, after creating the new @me.com address I soon found out that this is apparently now forever bound to my old Apple ID and cannot be changed. I mean why can't I delete the iCloud account and start anew with a different @me.com address??? Also, as everybody using iCloud must create an @me.com address why on earth can I not get rid of my old gmail address and have my entire Apple ID accessed through the new @me.com address? Creating a whole new Apple ID will not solve this as we are unable to transfer purchases between accounts.
    Apple products are great IMHO, but they do seem to not think things through in a very big way sometimes......

  • Lightroom Faces: Two People with the Same Name

    I downloaded Lightroom CC last night and came up with the following question:
    I have an uncle and a cousin with the same name...can Lightroom create two different "people" or will I need to name them each differently? I'm guessing it's the latter but figured I'd pose the question in case there is an alternate solution.

    johnrellis schreef:
    You might have a keyword for each family grouping, e.g. "John Ellis Family" and "Steve Ellis Family", and then place the keywords for the members of each under those parents.  E.g. under "John Ellis Family" you'd have "John Ellis", "Mary Ellis", "Jane Ellis", etc.   And under "Steve Ellis Family", you might have "Steve Ellis", "Kathryn Ellis", and "John Ellis" (a different John Ellis).
    It's a good idea to work with hierarchies. But for the face option to work, you will have to have two unique names.
    I just did a quick test.
    I have some images of twins in my catalogue, Tom and Boris.
    Under them, I created a "name" Twin. Because of the hierarchy, I can apply Boris>Twin to one image, Tom>Twin to another and both of them to a third photo.
    So I drag a name box around them and type "Twin". The drop down (auto fill) lets me choose between two identical looking entries called "twin". No way of knowing which one to pick. And maybe you've noticed that the auto fill drop down list starts with entries you used recently. So no good remembering that the top "Twin" will always be "Boris" for example.
    The count of used keywords only goes up for one of them if I happen to use the same entry twice.
    The only way for this to work (as far as I can tell now) is to drag the appropriate "Twin" from the keywordlist onto the right face in the People view (O).
    I work with hierarchies, but I make sure I have unique names.
    Also, I don't use spaces in the names, but rather JohnEllis, SteveEllis, etc. That way, if I have a very long list with Ellis members and also a lot of people called John or Steve, it's much easier to narrow the search for a particular person (like in smart collections).
    Opening the properties for the keyword, I make sure that "include on export" is NOT on, so you won't see that strange looking name Number123JohnEllis in your exported image.
    I have "export containing keywords" and "export synonyms" (and now with LR CC of course "Person") checked. As a synonym, you can put "John, Ellis, John Ellis, Steve Ellis family" and all of these will export.
    Hope this makes sense.
    Like John suggests, if you already create the Ellis Family>Steve Ellis Family>John Ellis>John>Numer123JohnEllis then you don't have to enter the synonyms, as long as you have "export containing keywords" on all of them checked, as well as "include on export" (except for the Number123JohnEllis keyword which shouldn't have "include on export" checked).
    Working with hierarchies can really help you in your keywording. But it will take some time to set it up.

  • When I try to install some plugins I get "Can't find Internet Plug-ins folder". Friends with the same machine using the same browser can download just fine.  What gives?

    When I try to install a plugin in any browser on my Mac Mini or my MacBook Pro, I get a "Can't find Internet Plug-Ins folder" message.  Other friends with the same machines can install the plugin just fine.  We can't find any reason why the plugin won't install on mine.  Any ideas out there?
    Thanks,

    Triple-click anywhere in the line below on this page to select it:
    /Library/Internet Plug-Ins
    Right-click or control-click the highlighted line and select
    Services ▹ Show Info
    from the contextual menu.* An Info dialog should open.
    Does the dialog show "You can only read" in the Sharing & Permissions section?
    In the General section, is the box labeled Locked checked?
    What is the Modified date?
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. Open a TextEdit window and paste into it (command-V). Select the line you just pasted and continue as above.

  • Stuck on sql query to find parent records that have the same child records

    Oracle 10gR2 Enterprise Edition.
    Hi,
    I'm trying to write some logic to look for records in a parent table, which have the exact same values in a child table.
    This is part of a bigger query, but I'm stuck on this part for now, so I've mocked up some simplified tables below to capture the core of the
    problem I'm stuck on.
    Let say I've got a parent table Manager, a child table Employee and there's a many to many relationship between them.
    The aptly named Join_Table handles the relationship between them. So one manager can manage many employees, one employee can be managed by
    many managers.
    I've a feeling this is stupidly easy, but I seem to be suffering from a bad bout of brain freeze today!
    -- parent table
    CREATE TABLE manager (
    id      number primary key,
    name      varchar2(100));
    -- child table
    CREATE TABLE employee (
    id          number primary key,
    name      varchar2(100));
    -- link table
    CREATE TABLE join_table (
    manager_id          NUMBER,
    employee_id      NUMBER,
    CONSTRAINT join_table_pk PRIMARY KEY (manager_id, employee_id),
    CONSTRAINT manager_fk FOREIGN KEY (manager_id) REFERENCES manager(id),
    CONSTRAINT employee_fk FOREIGN KEY (employee_id) REFERENCES employee(id)
    -- Insert some managers
    INSERT INTO manager (id, name) VALUES (1, 'John');
    INSERT INTO manager (id, name) VALUES (2, 'Bob');
    INSERT INTO manager (id, name) VALUES (3, 'Mary');
    INSERT INTO manager (id, name) VALUES (4, 'Sue');
    INSERT INTO manager (id, name) VALUES (5, 'Alan');
    INSERT INTO manager (id, name) VALUES (6, 'Mike');
    -- Insert some employees
    INSERT INTO employee (id, name) VALUES (101, 'Paul');
    INSERT INTO employee (id, name) VALUES (102, 'Simon');
    INSERT INTO employee (id, name) VALUES (103, 'Ken');
    INSERT INTO employee (id, name) VALUES (104, 'Kevin');
    INSERT INTO employee (id, name) VALUES (105, 'Jack');
    INSERT INTO employee (id, name) VALUES (106, 'Jennifer');
    INSERT INTO employee (id, name) VALUES (107, 'Tim');
    -- Insert the links
    -- John manages Paul, Simon, Ken
    INSERT INTO join_table (manager_id, employee_id) VALUES (1, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (1, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (1, 103);
    -- Bob manages Paul, Simon, Kevin, Jack
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 104);
    INSERT INTO join_table (manager_id, employee_id) VALUES (2, 105);
    -- Mary manages Jennifer, Tim
    INSERT INTO join_table (manager_id, employee_id) VALUES (3, 106);
    INSERT INTO join_table (manager_id, employee_id) VALUES (3, 107);
    -- Sue manages Jennifer, Tim
    INSERT INTO join_table (manager_id, employee_id) VALUES (4, 106);
    INSERT INTO join_table (manager_id, employee_id) VALUES (4, 107);
    -- Alan manages Paul, Simon, Ken, Jennifer, Tim
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 103);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 106);
    INSERT INTO join_table (manager_id, employee_id) VALUES (5, 107);
    -- Mike manages Paul, Simon, Ken
    INSERT INTO join_table (manager_id, employee_id) VALUES (6, 101);
    INSERT INTO join_table (manager_id, employee_id) VALUES (6, 102);
    INSERT INTO join_table (manager_id, employee_id) VALUES (6, 103);
    -- For sanity
    CREATE UNIQUE INDEX employee_name_uidx ON employee(name);So if I'm querying for manager John, I want to find the other managers who manage the exact same list of employees.
    Answer should be Mike.
    If I'm querying for manager Mary, answer should be Sue.
    This query will give me the list of managers who manage some of the same employees as John, but not the exact same employees...
    SELECT DISTINCT m.name AS manager
    FROM manager m, join_table jt, employee e
    WHERE m.id = jt.manager_id
    AND jt.employee_id = e.id
    AND e.id IN (
         SELECT e.id
         FROM manager m, join_table jt, employee e
         WHERE m.id = jt.manager_id
         AND jt.employee_id = e.id
         AND m.name = 'John')
    ORDER BY 1;I thought about using set operations to find managers whose list of employees minus my employees is null and where my employees minus their list of employees is null. But surely there's a simpler more elegant way.
    Any ideas?
    Btw, I need to run this as a batch job against tables with >20 million rows so query efficiency is key.

    What about...
    WITH manager_list AS
    SELECT name,
            LTRIM(MAX(SYS_CONNECT_BY_PATH(id,','))
            KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
    FROM   (SELECT m.name,
                    e.id,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) AS curr,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) -1 AS prev
             FROM   manager m,
                    join_table jt,
                    employee e
      WHERE m.id           = jt.manager_id
      AND   jt.employee_id = e.id
      AND   m.name = :P_MANAGER)
      GROUP BY name
      CONNECT BY prev = PRIOR curr AND name = PRIOR name
      START WITH curr = 1
    ), all_list AS
    SELECT name,
            LTRIM(MAX(SYS_CONNECT_BY_PATH(id,','))
            KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
    FROM   (SELECT m.name,
                    e.id,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) AS curr,
                    ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) -1 AS prev
             FROM   manager m,
                    join_table jt,
                    employee e
      WHERE m.id           = jt.manager_id
      AND   jt.employee_id = e.id)
      GROUP BY name
      CONNECT BY prev = PRIOR curr AND name = PRIOR name
      START WITH curr = 1
    SELECT a.*
    FROM   manager_list m,
           all_list a
    WHERE  m.employees = a.employeesWould be easier in 11g, but I don't have an installation here so this is based on 10g.
    Cheers
    Ben

  • Two people with the same comcast email adresses on two phones

    It used to  be that My wife and I shared the same Comcast email address and the mail came to both of our Windows phones. Something happened and she does not get Comcast mail anymore

    I fixed mine in the Contacts application on my MAC.  One of the sections under my contact details had "cards". Here was listed myself and the other person with (almost) similar name.
    I deleted the entry under "card" and the accounts were unlinked and the merged data were gone.
    In my case the "Google" card were the offending one. Once that were gone, problem solved.

  • Can I use 2 iPhones with the same iTunes account? help...

    At the moment I have an iPhone 3G but my wife doesn't. I have a Windows Vista machine at home that has all our music in iTunes and all the apps I have downloaded from the app store. We only have 1 login to our windows vista PC that we share, we don't have individual signons.
    On Friday I will be upgrading to the 3Gs and my wife will also be getting one.
    My question is can we sync both iPhones with the same PC using the same Windows login and the same iTunes account, i.e. share all music and apps with both iPhones?
    Thanks

    A computer can sync a dozen iPods and/or iPhones (just saying).
    However, You can't use more than one computer for that iPhone.

  • Is it possible to have 2 tables with the same name in an Orable database?

    Hello,
    I'm a complete Oracle newbie so please excuse my question if it's stupid.
    I was trying to create 2 tables with the same name using different tablespaces but it does not seem to work. Like this (second time just change the name of the tablespace):
    CREATE TABLE test_tbl (
      id INTEGER,
      status VARCHAR2(10),
      last_modified DATE DEFAULT SYSDATE
    TABLESPACE tblspc1Is it in general in Oracle possible to acquire this goal?
    Thanks a lot!
    P.S. I have already created the needed tablespaces
    CREATE TABLESPACE tblspc1 DATAFILE 'tblspc1.dbf' SIZE 10MEdited by: 808239 on 02-Mar-2011 02:18

    It is not possible to create two tables with same name in same schema.
    A user can own one schema with his own name and another with the schema name SYS.
    For this you have to grant sysdba privilage to the user and then have to connect using sys password or with the password specified in password file.
    But this still you have to access to the table in sys schema using sys.table_name.
    Hope Answered tthe Question.

  • Export to avi with the same quality. How ?!

    Hello,
    I'm using Adobe Premiere Pro CS5 to edit my video but i don't know how to export to avi file with the same quality...?!
    In the previous version Premiere Pro CS3 i can export the video into avi with the same quality using Windows Media Video 9 Codec but in Premiere Pro CS5 i don't know how to do it...!!
    Best Regards,
    Q8Xbox

    After you have downloaded and installed Lagarith and UT, reboot and just choose to Export to MS AVI, and then in the Compressor drop-down, choose the one that you want.
    Good luck,
    Hunt
    I am agree with you Bill but how can we import these codecs into adobe premiere pro.Because it expects only .epr extension for importing presets.Is there any other way then let me know.Thanks in advance

  • Since I upgraded to Yosemite I see "iMac" followed by a long number under "Shared" in the navigatie column of Finder. Every day a new item is added with the same number, but followed by (1), (2) etc. My iMac has gotten very slooooow.

    Since I upgrade my iMac to Yosemite I see "iMac" followed by a long number under "Shared" in the navigatie column of the Finder. Every day a new item is added with the same name and number, but followed by (1), (2) etc.
    I use Time Machine.

    I suffered with numbers next to my unit's name in Shared Devices, Finder Pane.
    What I did was turned off my Time Capsule and whilst it was off I renamed my Macbook Pro in System Preferences / Shared.
    I turned on the Time Capsule and thus far, 12 hours later the change has stuck.
    There are many people suffering this bug, it's to do with ghosting on your network... Where your current machine see's itself as a ghost, hence you get a numbered mac...???

  • I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image,

    I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image, the guidelines are not locked, it is annoying to have to lock them down again. and it would actually be nice, to ba able to give specific directions when placing the guidelines. Thanks

    Then why are the guides unlocked when I reopen a document that I saved with the guides locked ?
    Thanks.

  • Can two people with their own iPhones use the same computer and iTunes?

    Can two people with their own iPhones use the same computer and iTunes?

    Yes. My wife and I each have our own Apple ID and used the same computer to sync our phones with iTunes. The best way to do this is set up separate user accounts on the computer. If you are logged in to your account on the computer and your wife wants to sync here phone, you would log out and she would log in. These keeps all your stuff separate and avoids a ton of confusion.

  • My brother got his iphone s stolen a week or two ago. He didnt have the iphone finder app installed when it was stolen. He has recently gotten a new phone with the same phone number programmed. Is there any way to find the phone?

    My brother got his iphone 4s stolen a week or two ago, he didnt have the iphone finder installed at the time. The phone company just gave him a new phone progammed with the same number is there any way of tracking his old phone? If this is relevant whenever i call him and hes on the phone the phone connects to someone else answering machine.

    IF he set up find my ip[hone on the ihone itself BEFORE it was stolen ( there is no app, it is a setting) AND it is on AND it has jot been restored, then you may be able to track it using icloud/find my iphone.
    Otherwise, there is no way to track it.

Maybe you are looking for

  • Connect CUP (in GRC 10.0) with ABAP CUA

    Hi , Has anyone a short guide how to connect the CUP in GRC 10.0 with an ABAP CUA? We would like to use the CUP to trigger the CUA for the deployment of the CUP assigned authorisations. Thank you in advance! Br, Frank

  • 3000/N100 Mouse/Screen Resolution Problems with Windows 7

    This is my first post and I appreciate your service.  My problem is that after I upgraded from Vista to Windows 7, I find that my touchpad mouse will freeze up & the screen resolution will changes occasionally when I boot up my computer.  When this h

  • Determination of cost centre during MIRO for tax account

    Hi, We have the following scenario.  We need to raise an invoice via MIRO where tax is applicable.  As tax is not claimable, the automatically generated tax line is posted to a P&L account.  For this, being a P&L account, cost centre is required.  Bu

  • Layering in InDesign

    Are there pros and cons to assembling a graphic on a page in InDesign vs photoshop? I'm creating a 50 page book, and I often run into not knowing whether something should be done first in photoshop or indesign. There are times when I think the entire

  • Problems with iPad 3 using FaceTime after it was working and activated

    All of a sudden FaceTime not working.  In FaceTime the email address that was used no longer wants to store the password and every time I enter the password it tries to activate but then gives error