Browsing All posts tagged under »MSSQL«

UPDATE FROM…Oracle and MSSQL Examples

January 18, 2012

0

UPDATE FROM ** SQL version *** UPDATE erp.rse SET expardesc = r.expardesc || ‘ – ‘ || p.parname FROM erp.rse r INNER JOIN erp.omqc_paramdesc p ON p.rsid = r.rsid AND r.rtype = ‘PSVP’ *** Oracle vesrion *** UPDATE erp.rse SET rse.expardesc = rse.expardesc || ‘ – ‘ || (SELECT p.parname FROM erp.omqc_paramdesc p WHERE p.exparid […]

Oracle DECODE() and SQL Server’s CASE WHEN

January 18, 2012

0

DECODE EXAMPLE: SELECT supplier_code, decode(supplier_id, 10000, ‘IBM’, 10001, ‘Microsoft’, 10002, ‘Hewlett Packard’, ‘Gateway’) supplier_name FROM suppliers; The DECODE() function accepts a field name to evaluate, then allows you to specify what result should be returned based on the value in that field. The above example is evaluating the “supplier_id” field in a table, and specifying […]

UPDATE FROM – MSSQL Equivalent in Oracle

January 18, 2012

0

** SQL version *** UPDATE erp.rse SET expardesc = r.expardesc || ‘ – ‘ || p.parname FROM erp.rse r INNER JOIN erp.omqc_paramdesc p ON p.rsid = r.rsid AND r.rtype = ‘PSVP’ *** Oracle vesrion *** UPDATE erp.rse SET rse.expardesc = rse.expardesc || ‘ – ‘ || (SELECT p.parname FROM erp.omqc_paramdesc p WHERE p.exparid = rse.exparid) […]