Skip to main content
added 9 characters in body
Source Link
shA.t
  • 17.1k
  • 5
  • 59
  • 121

This is possibly a half nasty way of doing it, I used it once, was rather effective.

Depending on your goals it might be of use.

  1. Create a temp tabletemp table with one column.
  2. INSERT each lookupINSERT each look-up value into that column.
  3. Instead of using an ININ, you can then just use your standard JOINJOIN rules. ( Flexibilty++Flexibility++ )

This has a bit of added flexibility in what you can do, but itsit's more suited for situations where you have a large table to query, with good indexing, and you want to use the parameterisedparametrized list more than once. SavesSaves having to execute it twice and have all the sanitation done manually.

I never got around to profiling exactly how fast it was, but in my situation it was needed.

This is possibly a half nasty way of doing it, I used it once, was rather effective.

Depending on your goals it might be of use.

  1. Create a temp table with one column.
  2. INSERT each lookup value into that column.
  3. Instead of using an IN you can then just use your standard JOIN rules. ( Flexibilty++ )

This has a bit of added flexibility in what you can do, but its more suited for situations where you have a large table to query, with good indexing, and you want to use the parameterised list more than once. Saves having to execute it twice and have all the sanitation done manually.

I never got around to profiling exactly how fast it was, but in my situation it was needed.

This is possibly a half nasty way of doing it, I used it once, was rather effective.

Depending on your goals it might be of use.

  1. Create a temp table with one column.
  2. INSERT each look-up value into that column.
  3. Instead of using an IN, you can then just use your standard JOIN rules. ( Flexibility++ )

This has a bit of added flexibility in what you can do, but it's more suited for situations where you have a large table to query, with good indexing, and you want to use the parametrized list more than once. Saves having to execute it twice and have all the sanitation done manually.

I never got around to profiling exactly how fast it was, but in my situation it was needed.

Source Link
Kent Fredric
  • 57.6k
  • 14
  • 112
  • 151

This is possibly a half nasty way of doing it, I used it once, was rather effective.

Depending on your goals it might be of use.

  1. Create a temp table with one column.
  2. INSERT each lookup value into that column.
  3. Instead of using an IN you can then just use your standard JOIN rules. ( Flexibilty++ )

This has a bit of added flexibility in what you can do, but its more suited for situations where you have a large table to query, with good indexing, and you want to use the parameterised list more than once. Saves having to execute it twice and have all the sanitation done manually.

I never got around to profiling exactly how fast it was, but in my situation it was needed.