mercredi 5 octobre 2016

Alternative to cursor when applying a list of values to a where clause?

Vote count: 0

What's an alternative to getting a distinct number of dates, say all the dates for September:

9/1/2016
9/2/2016
9/3/2016

and apply each value to a query. Say something like:

Select GuitarId,GuitarBrand
From GuitarSales
Where GuitarDate = @date

I don't want to use a cursor, is there an alternative to doing this?

I tried a CTE but even then I'd have to apply the cursor for each date.

asked 24 secs ago

Let's block ads! (Why?)



Alternative to cursor when applying a list of values to a where clause?

Aucun commentaire:

Enregistrer un commentaire