Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

optimize my query

$
0
0

Hi,

I wonder how would the query like if (data is included at the bottom):

For a given person, if he/she has Plan A, in my output, I will replace F1 with Plan B's F1 value.

In this case, Person1's  Plan A becomes

Person1   Plan A    F1b    F2a

For Person2 Plan A becomes:

Person2   Plan A    F1d    F2a

Data:

Person    Plan        F1     F2

Person1   Plan A    F1a    F2a

Person1   Plan B    F1b    F2b

Person1   Plan C    F1c    F2c

Person2   Plan A    F1a    F2a

Person2   Plan B    F1d    F2d


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>