Connecting Tech Pros Worldwide Forums | Help | Site Map

Help with search query

Scott Schluer
Guest
 
Posts: n/a
#1: Nov 18 '05
Two questions related to SQL searches (ideally everything will be in a
stored procedure):

I have an ASP.NET checkboxlist on a search page (this is a search of
properties for sale). The checkboxlist is responsible for displaying the
available amenities in a home (air conditioning, patio, garage, etc.). I
have a table tblAmenities with columns amenity_id and amenity_name. Another
table tblProperties with columns property_id, property_address, etc. Then a
lookup table that uses the property_id and amenity_id to associate amenities
with various properties.

My question is, when the user selects various checkboxes from this list
(whose values correspond to the amenity_id of the particular amenity they
chose), how do I structure the SQL statement to do the search?

Along with this question is how do I rate the results of my search by a
percentage match (among all of my search fields, including the amenities).
For example, with two identical houses, with the exception that one has 20
of their selected amenities, and the other only has 1, the one with 20
should be displayed first, along with an indicator: Percentage Match: x%.

Thanks,

Scott



Roji. P. Thomas
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Help with search query


>>Two questions related to SQL searches
One answer for every questions related to SQL searches

http://www.sommarskog.se/dyn-search.html

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


"Scott Schluer" <usenet@webservicesinc.com> wrote in message
news:%231uVyM0lEHA.2968@TK2MSFTNGP14.phx.gbl...[color=blue]
> Two questions related to SQL searches (ideally everything will be in a
> stored procedure):
>
> I have an ASP.NET checkboxlist on a search page (this is a search of
> properties for sale). The checkboxlist is responsible for displaying the
> available amenities in a home (air conditioning, patio, garage, etc.). I
> have a table tblAmenities with columns amenity_id and amenity_name.[/color]
Another[color=blue]
> table tblProperties with columns property_id, property_address, etc. Then[/color]
a[color=blue]
> lookup table that uses the property_id and amenity_id to associate[/color]
amenities[color=blue]
> with various properties.
>
> My question is, when the user selects various checkboxes from this list
> (whose values correspond to the amenity_id of the particular amenity they
> chose), how do I structure the SQL statement to do the search?
>
> Along with this question is how do I rate the results of my search by a
> percentage match (among all of my search fields, including the amenities).
> For example, with two identical houses, with the exception that one has 20
> of their selected amenities, and the other only has 1, the one with 20
> should be displayed first, along with an indicator: Percentage Match: x%.
>
> Thanks,
>
> Scott
>
>[/color]


Closed Thread