Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.
if condition equal to true then I would like multiplication
(od.price * od.kilo), and then bring the other fields
else
I would like multiplication(od.quant * od.price) and then bring the other ...
Could storing wildcard strings in a table's column (to be used as the second operand of the LIKE operator in queries) cause any non-obvious behavior? I'm wondering especially about the possibility of ...
I have a table that looks like this:
id | machine | date | status
----------------------------
1 | 1 | 01-01-2009 | New
1 | 1 | 01-01-2010 | Busted
1 | 2 | 01-01-2010 | New
1 | 1 | 01-01-2012 | ...
I want to answer for this SQL statement.
INSERT INTO CUSTOMER (customerid,customername) VALUES(1,'alpha');
INSERT INTO CUSTOMER (customerid,customername) VALUES(2,'beta'); SAVEPOINT s1;
INSERT INTO ...
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.