Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Normalising Data
Message
 
To
28/11/2012 09:28:46
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01558244
Message ID:
01558256
Views:
57
>>
>>INSERT INTO [Rates]
>>           ([rat_pk]
>>           ,[rat_name]
>>           ,[rat_type])
>>     (SELECT newid()
>>           ,[SpecialRate]
>>           ,[rat_type]
>>      FROM (SELECT DISTINCT SpecialRate
>>                          ,case when SpecialRate like 'Mail%' 
>>                                     then 2
>>                           case when SpecialRate like 'ZipX%' 
>>                                     then 3
>>                           else 1 end AS [rat_type]
>>            FROM [Weight Rates-Special Rates]) Test)
>>
>>NOT TESTED!
>
>
>Thanks! Good enough to get the brain going again :)


:-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform