Select Query using join ,difference,like

  • i am using Patient table with firstname ,lastname,address, homephone.

    i want to search the patient's family member --having same lastname,homephone,address...from the table.

    this should display in the dataset while i type the values in my textbox control.

    how to write query to get this similar information....

    E.g. :

    suppose one patient having address Jay Prakash Nagar..

    and new patient given address as J P Nagar/JP Nagar then also it should give me all the possible combinations of address....

    Please help

  • I would suggest looking into the SOUNDEX functionality built into SQL Server http://msdn.microsoft.com/en-us/library/aa259235(SQL.80).aspx. This could help in certain instances while in your particular example in probably wouldn’t.

    At a previous job I implemented something similar for a travel website where misspellings of travel destinations were common. We kept a separate table with the misspellings and linked them to the value of the correct spelling. Therefore the site would operate normally under most circumstances (correctly or misspelled destinations).

    For your example you could create some simple algorithms that mimic the common ways people misspell names and addresses and populate your new "misspelled" table on each new insert into your correctly spelled table.

    Finally do a join on these tables when searching for your results.

    Regards,

    Justin

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply