[dba-SQLServer] Odds and evens

Susan Harkins ssharkins at gmail.com
Tue Nov 25 12:42:09 CST 2014


I don't think you need two views, just a procedure to pass the appropriate
filtering criteria.

Susan H.

On Tue, Nov 25, 2014 at 10:26 AM, Arthur Fuller <fuller.artful at gmail.com>
wrote:

> An app I'm currently sketching out needs to list addresses by street, but
> with a kicker: I want to two groups per street -- odd and even street
> numbers. Ultimately, the front end will present a list of streets, and let
> the user select odd or even numbers, resulting in a list of those odd or
> even addresses.
>
> One idea I haven't really thought through yet would involve using the
> modulus to distinguish the two groups, and then maybe build two views,
> based on whether the modulus is 1 or 0. Then I could just swap the views,
> depending on the user's choice of odd or even. In this scenario, the index
> would be StreetName, Modulus(StreetNumber), or something like that
>
> Any alternative suggestions?
> --
> Arthur
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>
>


More information about the dba-SQLServer mailing list