Monday, March 26, 2012

query

Hi,
i have a model column and has all sort of names.
E.g.
Model names
CRUZERCROSSFIRE00512
EXTREME512MBCF
EXTREMECF00256
EXTREMEIIISECUREDIGITAL
ULTRAIIMAGICGATEMP00512
ULTRAIIMAGICGATEMP01024
X00512
I have a new column and this new column is to differentiate the model
belongs to High or Std. Any model name that starts with Extreme or Ultra will
be High and others will be Std
e.g.
Model New Column
CRUZERCROSSFIRE00512 Std
EXTREME512MBCF High
EXTREMECF00256 High
ULTRAIIMAGICGATEMP01024 High
ULTRAIIMAGICGATEMP00512 High
X00512 Std
I am not sure how to write a query to populate the data in the new column.
Kindly advise.
Thank you
Hi 'Tiffany',
It's considered a bad idea to take over another person's thread. You should start you own. Folks may not look it your problem since they will consider it a continuation of the previous thread and you may not get help.
You could try something like:
SELECT
Model,
NewColumn = CASE
WHEN Model LIKE 'EXTREME%' THEN 'High'
WHEN Model LIKE 'ULTRA%' THEN 'High'
ELSE 'Std'
END
FROM MyTable
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the top yourself.
- H. Norman Schwarzkopf
"Tiffany" <Tiffany@.discussions.microsoft.com> wrote in message news:4DF539CC-CD49-49EE-9E6B-B7084EF0B602@.microsoft.com...
> Hi,
> i have a model column and has all sort of names.
> E.g.
> Model names
> CRUZERCROSSFIRE00512
> EXTREME512MBCF
> EXTREMECF00256
> EXTREMEIIISECUREDIGITAL
> ULTRAIIMAGICGATEMP00512
> ULTRAIIMAGICGATEMP01024
> X00512
> I have a new column and this new column is to differentiate the model
> belongs to High or Std. Any model name that starts with Extreme or Ultra will
> be High and others will be Std
> e.g.
> Model New Column
> CRUZERCROSSFIRE00512 Std
> EXTREME512MBCF High
> EXTREMECF00256 High
> ULTRAIIMAGICGATEMP01024 High
> ULTRAIIMAGICGATEMP00512 High
> X00512 Std
> I am not sure how to write a query to populate the data in the new column.
> Kindly advise.
> Thank you
>
>
|||Hugo,
I wasn't trying to give Tiffany grief, just concerned that her posting would
be 'lost' and not garner any attention.
And yes, I 'forgot' that OE can combine different threads that just happen
to have the same subject.
About your request that I alter my sending settings, I have no reason not to
do what you ask, but I just can't find any settings similar to 'Settings for
Unformatted text". Also can't find any information on "Line Breaks", or
"unformatted text" in OE help. Any other ideas?
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Hugo Kornelis" <hugo@.perFact.REMOVETHIS.info.INVALID> wrote in message
news:opgnk2dp2h7t1sgovd8skqfnd3iefd14q6@.4ax.com...
> On Sun, 29 Oct 2006 19:09:36 -0800, Arnie Rowland wrote:
>
> Hi Arnie,
> Just as an FYI, Tiffany didn't take over any thread. She posted a new
> thread, with a subject that happens to be quite popular. So your news
> reading software (like mine) uses a title matching algorithm to show you
> a threaded structure that never existed.
> This technique is great to keep thread structure intact if some posts
> don't contain accurate "references" headers, but it bites you in the leg
> with unrelated postings that use a common subject.
> Oh, and while we're on the subject of news readers, could you please set
> up your news client to include line breaks, as still is standard on
> usenet? I see that you're using Outlook Express; you'll find the option
> to change this throug "Extra" / "Options" / "Send" / (Layout for sending
> news) "Settings for unformatted text"
> --
> Hugo Kornelis, SQL Server MVP

No comments:

Post a Comment