Search criteria to find the friends of a friend

Person old s/n

I need to make the database where I need to look for the person of the current user. The current user can have many friends in his friend list, but that search for the current user can be it is not a friend of the current user and learn how current user known to that person. As the string of a friend.
Suppose that i m Aman discover "San." my friends are AEK, johan, satish etc..
still a friend of aek is 'San' and
Sissi is one friend of Mohan, Mohan another friend of shabani and Sanju will be a friend of "San."

so 'Aman' knows 'San' by two ways a way by Aerts and 2nd by Satish. As link will be

Aman-->--> San Abhi
Aman->->->-> San Sanju Mohan Sissi

which way I ask which is used by linkedin (www.linkedin.com)

So, please tell me what is better, the search criteria is used to achieve the objective of performance because records can be in the billions.

should be like this

create table (PALS)
pal_id number primary key,
Name varchar2 (100));

drop table FRIENDS;
create table (FRIENDS)
number of pal_id
friend_id number,
primary key (pal_id, friend_id)
Foreign key (pal_id) refers to PALS (pal_id).
Foreign key (friend_id) refers to PALS (pal_id)
);

insert into friends values (1, 'A');
insert into values of pals (2, 'B');
insert into friends values (3, 'C');
insert into pals values (4, 'd');
insert into friends values (5, 'E');
insert into values of pals (6, 'F');
insert into values of pals (7, 'G');

insert into friends values (1, 2);
insert into friends values (1.3);
insert into friends values (2.5);
insert into friends values (5.7);
insert into friends values (3,4);
insert into friends values (4.6);
insert into friends values (6,7).
commit;

-find leads to G
with PF as)
Select p.pal_id, p.name, f.friend_id, pf.name a friend
friends p
Friends join f on p.pal_id = f.pal_id
Join the friends pf on pf.pal_id = f.friend_id)
Select the level, pf.name, pf.friend
PF
connect by prior pal_id = friend_id start with a friend = "G";

     LEVEL NAME       FRIEND
---------- ---------- ----------
         1 E          G
         2 B          E
         1 F          G
         2 D          F
         3 C          D          

then you have to unwrap it in demand.
Maybe it is also possible in SQL.

Published by: Mark Malakanov (user11181920) January 10, 2013 10:56

I found out how do

with PF as)
Select p.pal_id, p.name, f.friend_id, pf.name a friend
friends p
Friends join f on p.pal_id = f.pal_id
Join pals pf on pf.pal_id is f.friend_id),
W as)
Select the level, pf.name, pf.friend,
Name CONNECT_BY_ROOT R,.
SYS_CONNECT_BY_PATH(Friend,'-> ') P,.
CONNECT_BY_ISLEAF IsLeaf
PF
connect pal_id = prior friend_id start with name = "A".
)
Select R | P P of W where IsLeaf = 1 and friend = "G";

P
--------------------------------------------------------------------------------
A -> B -> E -> G
A -> C -> D -> F -> G  

Published by: Mark Malakanov (user11181920) on 10 January 2013 11:28

Published by: Mark Malakanov (user11181920) on 10 January 2013 11:33

So, please tell me what is better, the search criteria is used to achieve the objective of performance because records can be in the billions.

create index PALS_NAME on PALS (NAME);
or use PAL_ID in
connect pal_id = friend_id prior start with PAL_ID = 1

Published by: Mark Malakanov (user11181920) on 10 January 2013 11:42

Published by: Mark Malakanov (user11181920) on 10 January 2013 11:44

Tags: Database

Similar Questions

  • Req. search criteria to find the values of table in the entire schema.

    Hello

    I have an obligation to identify the value of the particular column that is longer in a table in the schema.
    We have all the Tables system or any other source admin level?

    For example, I have customer id in 18 paintings in our scheme.

    I need like... I want to return to the table of names which are all contains the customer id = 15326.

    If the 7 of 18 table contains the value of the id of customer 15326, then that is my output required that he picks up.
    Don't we have any source to identify this requirement?

    More picture... Customer, CustomerB, ClientC clients client are the tables in the schema that contains the customer id column.

    Here, customer and ClientC contains the value of the identification of customer 15326 folder. So, I need produce the output as the Table names are customer, ClientC.

    I hope, you will understand my requirement.

    Please do the necessary help / advice on that.

    Thank you
    Orahar.

    Re: search string in DB

    Read the link.

    Concerning
    Asif Kabir

  • Windows 7: the search does not find the files that should be, directory is indexed and *.php included on the list of extensions

    Windows 7: search does not find the files that should be. I have indexed directory and *.php included on the list of extensions, but search can't find files for Word searches that I know there are files with these words in them.

    If you're frustrated by research (aka Desktop Search), you are not alone. Click the Start button and type find and click the button 'change the way Windows search'. Now click on the Advanced button and select the tab file types scroll down and find your type of file (in your case .php) and make sure the radio button "index properties and the content of the file" is selected for the file type.

    Out the form by clicking on the OK button, but do not close the form when you click the Advanced button.

    Then, you may need to change the indexing locations. If the folder where your files are located is not known for indexing search, then search is not even bother looking for here (a source of frustration for many users). Maybe your files are located on another drive or partition without the knowledge of the indexing engine. Using the options icon and select/deselect expand, make sure that at least the files of interest are included for the indexed locations. I hope this helps.

    samc1

  • Windows 7 search did not find the result of a formula in excel file

    Hello

    I have some files stored in a folder specific excel. In excel files, there are some formulas. Windows search, I want to find the file that shows the result of a particular formula. When I search, it not find the file with the text, the result of the formula. Can someone help me please?

    Windows cannot do this, because the formula has not been assessed or calculated yet.  Only Excel can calculate the result of the formula and show the answer, so you must open the file in Excel before you can find the result.

  • using the function search is not finding the words I know are in my document. Why?

    using the function search is not finding the words I know are in my document. Why?

    The fact that you see a Word does not mean that it is 'real' text. You can select the word? If so, copy and paste in another application (such as Notepad). He always look the same? If the answer to each question is, you also cannot find it by using a search.

  • 1 - where is the search function to find the authors muse a list?

    1 - where is the search function to find the authors muse a list?

    Hello

    Regarding your first question of the creation of a search box in your site from muse, please see this forum post:- Re: how to create a search box in MUSE?

    In addition, you can use different widgets available on Adobe Exchange .

    Now, regarding your second please can question of the creation of a bulleted in Muse, you these tutorials:

    Adobe help Muse | Bullets and numbers

    Bullets and lists numbers | Adobe Muse CC tutorials

    Now, it seems that the Muse version you are using is obsolete and it is possible that you might not find these features in it. I would ask update you your Muse to the latest version 2014.2 using the CC desktop application to take advantage of all these features. Please refer to this screenshot:- http://prntscr.com/55uvs9

    Hope this helps

    Kind regards

    Rohit Nair

  • Windows search fails to find the files in the Documents folder

    Original title: Windows 7 search finds no files, even though all the settings have been verified and the search index has been rebuilt

    I recently bought a new Dell laptop Studio 1558 with Windows 7 Home Premium and moved through several hundred documents from my old PC to the new folder 'My Documents'.

    As many others have found, Windows Search has been completely useless. She seems to have no problem finding files in the music folder or image, but anything in the document library is invisible to the it - even if I get in a subfolder small for a file name I see just in front of me, Windows Search will announce that "no element not corresponding to your search.

    I took a number of steps so far to fix the problem, which none have worked:

    1. I checked which locations are indexed for search and ensured that the document library is among them (as well as all of my C drive).

    2. I checked that appropriate file extensions (.doc .docx .pdf, etc.) are all selected from the "File Types" list in indexing options (although I noticed that 'Description of filter' for .pdf bed "Registered IFilert is not found" - not this problem with Word documents).

    3. I have deleted and rebuilt the search index.

    4. I ran the troubleshooting Windows 7 Search tool, which reports that it cannot find any problems.

    5. I have read that some problems with Windows 7 search can be solved by changing a registry key (http://www.intowindows.com/how-to-fix-windows-7-search-problems/) but when I navigate to the folder in my registry, only following three keys are here (not the one mentioned in the difficulty):

    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\ {0B2BAAEB-0042-4DCA-AA4D-3EE8648D03E5}
    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\ {36011842-DCCC-40FE-AA3D-6177EA401788}
    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\ {59BD6DD1-5CEC-4D7E-9AD2-ECC64154418D}

    A couple of things, I said - if I create a new word document and save it, Windows Search seems to immediately get back on it and is able to find. I also noticed that at first when I opened one of the word documents that have been transferred over the old PC and then closed it again, Windows Search picked up on it and could find it. So I went to try to open and close then all of my documents (an arduous task...), but the subject to halfway through Windows Search has ceased to be able to find them.

    All Word documents using Microsoft Word 2007 in .doc or .docx format, although the problem also applies to Excel, PDF and image files, so I don't think that the problem is with the word itself.

    I have tried everything I can think so far, including all the solutions, I could see suggested in previous discussions. I really need the search function working to effectively use my laptop so that any help would be welcome!

    Thank you, Jack

    Santosh thanks, I checked the permissions for the appropriate files and SYSTEM was present, which doesn't seem to be the problem. However, I found a solution that might work for other people are having the same problem.

    I noticed that if I changed the location of the files, Windows search suddenly seems to become aware that they existed and then indexed and followed them correctly - even if they were subsequently moved back to the original location. I just created a temporary folder outside my library of documents and then each subfolder in the folder my documents him and then come back, one by one. It was a bit laborious but the problem solved - I know not why it worked, but all the old files are now indexed and appear correctly when you use Windows Search, and it seems not to have any problems, follow-up of the newly created files.

    Cheers, Jack

  • [JS] [CS4] Search pages to find the first application of a master spread?

    I'm working on a script that search masters spreads for specific text. Once it is found, the master spread name is returned. Now I'm stuck looking for pages to find where this master spread is applied first. Any help?

    var doc = app.activeDocument;
    
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
    app.findChangeTextOptions.includeMasterPages = true;
    app.findTextPreferences.findWhat = "custom text";
    
    var finds = doc.findText();
    if (finds.length > 0) {
        
              var mspage = finds[0].parentTextFrames[0].parent.name;
              var dpage = doc.pages[0].appliedMaster.name; //This of course is not right, it's returning the name of the master spread for whatever page is currently selected. So how do I set the current page to the page that first uses the found master spread (mspage)?
    

    You will have to look for him.

    var i, dpage;
    for (i=0; i<=doc.pages.length; i++) {
      if (doc.pages[i].appliedMaster == mspage) {
        dpage=doc.pages[i];
        break;
      }
    }
    

    However, if ever he finds one, you will get an error.

  • (windows search) Windows cannot find the search.

    Hello
    I installed windows search 4, xp, the first operating system was when I set up the search, the search does not now, taking the index is complete he said, the problem isn't getting indexed. Is there that an overlap knows nothing. Can help you in this regard. Thank you in advance.

    Hi AliAVCI,

    1. What is the full error message that you receive?

    2. did you of recent changes on the computer?

    3. it happens with all the searches that you perform?

    See the link below and run them the fixit tool available, check if it works.

    Fix Windows Search when it crashes or shows no results

    http://support.Microsoft.com/mats/windows_search/

  • How to add to the search filter to find the title empty

    How can I use the file PDF from windows to search has empty title or it has no author. When I write this filter ' title: ' I shows me all the pdf, including, Untitled.

    The square brackets are taken to mean empty, then you can try:

    ext:PDF (title: [] GOLD author: [])

    However, I have found that my Windows 7 is not read the title and author of the metadata of files pdf in the first place, I can not correctly look for any title or author information at all for the pdf files.  Someone here can search for these metadata pdf (excluding use of the libraries indexed)?

  • The search function will find the content of the banner?

    I see that the search only works with items and NO banners and collections. It will be something that will be added to collections or banners.

    (1) is currently only to objects.

    (2) Yes, at one time given, it can be extended, but there is no time horizon clear for when and if it will happen.

  • How to review the Photos Smarfolders my search criteria?

    Hello.  I made several smartfolders in the Photos app, using demanding search criteria to group the images.  Now, I would like to add to these folders with newly imported equipment.  How can I see the search criteria, that I put initially for the smartfolders, please?  It would really help see what I did, so that I can adjust the keywords and descriptions of new elements to match the search criteria, I did for the smartfolders.

    Thank you.

    Control (right) - click on the smart album and select Edit Smart Album in the context menu.

  • Modify the search criteria for my tabular presentation...!

    Hey guyz I m back with a query related to my form of tables that I have developed with your help...
    I submitted my application to management 2 day... whatever it well spent, but they want change me the search criteria according to the needs of thr.

    1. they want to understand me a drop box that has all the fields in the table as dispalyed... EMPNO, STC, NAME, NATIONALITY, STATUS,
    and next to the drop box, they want to understand me a field blank as if NATIONALITY select in the drop down box and enter the nationality question in the search box button and press search, I should get all the emp with specific nationality

    EX: In the drop-down list select NATIONALITY and in the search box, I type GERMAN,... now, when I click I get all available in business German



    2. we got ratings for all the emp in percentages
    Now, select in the drop POSITION in the box enter (HP: 80 - 90) then I should be able to recover all the EMP working with HP position and ratings between 80-90%
    FOR EX: DROPBOX: Position
    TEXT ELEMENT: HP: 80 - 90
    Click on search, I get all the EMP with assessment between 80-90 and so on

    How can I change this... .creating a separate search for each column box would have been easy, but how do I apply this what the management wants me... ???

    Hello!

    You have the list item and the research element already created?

    PRE-REQUETE trigger on the table block (it's the easiest way)

    declare
    l_eva_min number;
    l_eva_max number;
    
    begin
    if
      :block.list_item = 'NATIONALITY'
    then
      :tab_block.NATIONALITY ´:= :ctl_block.search_item;
    elsif
      :block.list_item = 'EMPNO'
    then
      :tab_block.EMPNO := :ctl_block.search_item;
    elsif
       :block.list_item = 'POSITION'
    then
      :tab_block.POSITION := :ctl_block.search_item;
      if
        instr ( :ctl_block.search_item, ':' ) > 0
      then
        l_eva_min := substr ( replace ( :ctl_block.search_item, :ctl_block.search_item || ':' ), 1,
                              instr ( :ctl_block.search_item, ':' ) -1 );
        l_eva_max := substr ( :ctl_block.search_item, instr ( :ctl_block.search_item, '-' ) + 1 );
        :tab_block.EVALUATION := '# between ' || l_eva_min || ' AND ' || l_eva_max;
      end if;
    elsif
      ...
    end if;
    end;
    

    He is an untested prototype.
    Please make sure that the length of the assessment element query property is set
    length to hold the above query string.

    Concerning

  • My Outlook Express gives me an 0x800C0133 error. Impossible to delete my messages from the Inbox. Also, I don't find the file indox.dbx.

    I read the post on the copy the messages from the Inbox to another folder.  I tried, but get an error message.  I decided that I would just delete all but the messages will not delete.  I used the search function of windows to search for inbox.dbx, but he could not find the file.  I have a large number of messages in my Inbox and its ok if I lose all.  I get the error message when I start outlook express and download messages from my pop3 e-mail.  It still downloads messages from one of my other emails which is also a pop3 server.  I have windows xp pro and it is completely up to date.  Thank you...

    Hello craigalene,

    This issue may occur because of corrupted inbox in Outlook express.

    Perform the following troubleshooting steps and check if this solves the problem.

    Step 1:

    Create a new folder and move all mail from your Inbox to the new folder in Outlook Express.

    Follow these steps:

    a. click on the file menu.

    b. Select the folder and select new.

    c. give an appropriate name for the folder.

    d. Select all mails in the inbox and move to a different folder.

    e. move mail to the new folder.

    Step 2:

    I suggest to delete the Inbox.dbx file in your computer.

    In Windows XP Outlook Express files user (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under Start, Control Panel, Folder Options and view.

    Follow the steps to delete the Inbox.dbx file.

    a. close Outlook Express.

    b. use the search option to find the box of Inbox.dbx.

    c. delete the Inbox.dbx file.

    Note: Another will be created automatically when you open Outlook Express.

  • Mac OS 10.5 Hello cannot find the printer driver for P1606dn connected via a wired network.

    I tried to connect my HP Laserjet Pro P1606dn to my PowerMac G5 running Mac OS 10.5.8.  I have connected the priner to my LAN via the Ethernet cables and Switch 8 port NetGear.  I then properly installed printer driver from the CD provided on the Mac and went into system preferences / Print & Fax to add the printer to the list of the connected printers.  Click on the button «+»  The HP P106dn was listed in the table (kind = Hello).

    I chose this entry in the table, and the dialog box immediately went into action: the pullodwn "to Print using" listed the message 'Please select a printer or driver model' greyed and a spinning wheel called 'Search for new drivers' appeared underneath.  The dialog box search but never find the printer driver (I waited for 20 minutes without success).  I installed some other HP printers in this way on this machine with no problems, for example, HP Color Laserjet 2605dn.  Why this method does not work with this printer?

    I was able to connect to this printer with other (Intel) Macs in my house through this arrangement of LAN.  Is the printer driver for the Intel Macs only?

    I disconnected the printer from the local network and connected directly to my Mac with a USB cable.  The same process, and I was able to connect to this printer.  Successfully print a document page.  Although it gives me a work-around for Mac G5, I need to share this printer with other Macs in my household.

    I went on the HP download site and downloaded the latest driver for this printer, re-installed the printer driver on Mac and repeat the steps for the arrangement of LAN (above) complete the connection via the Print & Fax dialog box.  The result was the same: spinning wheel looking for a printer driver are not.

    I don't know what else to do, or why this facility will not work.  I would much appreciate it if someone could give an explanation for this or any suggestions as to what can be done?

    Ed

    I'm sorry to get back to you on this so late.  I was OOT Sunday all day.

    Ok. So, here is what happened.  As I mentioned at the end of my last post, I was in the process of resetting my printing system, repair disk permissions, then restarting.   Reset the printing system wiped out all my printers in the "Printers" pane in the "Print & Fax" system preferences dialog window  I moved forward and fix permissions of the drive on my system disk.  A number of authorities have been repaired, but nothing that I could decipher impression related ro.  Finally, I restarted my Mac and went directly to the dialog box print & Telec.

    As the printers pane was still empty, I'm gone before adding the simplest of my printers (LaserWriter 360 connected via AppleTalk) who has always been correctly added to the list printers in the past.  No chance!  WAITED a few minutes everything is was "Looking for new drivers.".  I tried the Color Laserjet 2605dn.  No luck.  Then the Laserjet P1606dn.  No luck.

    Thus, this way of solution did not work, and now I was without any driver associated with one of my connected printers.  I decided that I had no choice to rebuild the operating system.  I started my DVD of Installation OS 10.5.4 to rebuild my system (without reformatting my HARD drive).  Once which was finished, I've immediately went to the Print & Fax dialog box and tried to add in each of my printers.  In a few seconds the LaserWriter was added successfully, then the HP Color Laserjet 2605dn, and FINALLY, the Laserjet P1606dn.  Thus, it appeared that my upgrade to OS 10.5.8 was at the origin of the problem.

    I proceed with Sofware Update to restore the computer to OS 10.5.8 and again once, went to the dialog box Print & Fax to experiment with the addition of each of the printers again.  Stopping before the acceptance of each 'Add', I could find quickly and successfully the drivers for each of the connected printers.  So, it doesn't seem to be a problem with OS 10.5.8 find printer drivers.

    After reflection, I concluded that the problem must have appeared during the upgrade to OS 10.4.11 OS 10.5.4, but it remained hidden until I tried to add these new printers to the list of printers.

    I appreciate the reference to the last download Laserjet full feature software.   Since I was able to solve the problem without it, I mind not do the download.

    I want to thank you for patiently stay with me during the last two weeks, your advice and comments.  Just having someone to "talk" about it, it was reassuring and useful that I went along to apply each suggestion to the problem.  I tried to solve this problem several times on my own before that, the search of the forums, and I hesitated to participate actively – to reach out.  I'm feeling very different about it now.  Once again, thanks a lot.

Maybe you are looking for