[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

SV: [PROGRAMMERING] [SQL] Erstatning af indhold i felter



I mysql skal du skrive flg.
update table set felt=(replace(felt,'x','y'));

Men ellers er det vist det samme.

Med venlig hilsen

Jan Andersen

-----Oprindelig meddelelse-----
Fra: Martin Møller Pedersen [mailto:sslug@sslug 
Sendt: 5. juli 2005 11:42
Til: sslug@sslug
Emne: Re: [PROGRAMMERING] [SQL] Erstatning af indhold i felter

> Hvordan gør jeg dette, når det ikke er hele indholdet af et felt jeg vil
> erstatte? Jeg er med på at jeg laver en
> 
>  > UPDATE `tabel` SET `felt` = '....'WHERE (en eller anden kondition)
> 

Jeg ved ikke med MySql, men i Oracle SQL kan du skrive noget a la:
UPDATE table SET felt=replace('x','y');


> , når jeg kender hele indholdet af feltet. Men det jeg vil er at
> erstatte en tekst bestående af noget "ukendt" tekst og nogle hyperlinks
> - teksten skal bevares, men linksene skal erstattes.
> 
> Normalt ville jeg lave en sed/.../.../, men den går ligesom ikke helt
> her. Hvad gør man så?
> 
> Tak,
> Anders
> 


-- 
"All general statements are false."
"If atheism is a religion, then not collecting stamps is a hobby."

A: Fordi det ændrer rækkefølgen folk normalt kommunikerer på.
Q: Hvorfor er top-svar en dårlig ting?
A: Top-svar.
Q: Hvad er det mest irriterende i e-mail?



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *