User Tools

Site Tools


sql

Update string

UPDATE data SET VALUE = REPLACE(VALUE, '123', '') WHERE ID <= 4 AND Value LIKE '%123%'
SELECT CASE <variable> WHEN <value>      THEN <returnvalue>
                       WHEN <othervalue> THEN <returnthis>
                                         ELSE <returndefaultcase>
       END AS <newcolumnname>
FROM <table>
SELECT
    FirstName, LastName,
    Salary, DOB,
    CASE Gender
        WHEN 'M' THEN 'Male'
        WHEN 'F' THEN 'Female'
    END
FROM Employees
sql.txt · Last modified: 2017/11/14 10:21 by Jan Forman