Hope you are doing well. I am really new to SQL and was wondering whether anyone could just quickly confirm something for me.
I want write an SQL Query that would create an output which I want to export as a csv. I have already created the query which uses SELECT, CASE, FROM and WHERE. I wanted to run this query in the query window of SQL Server Management Studio, take the output on the bottom of the screen, right click and hit export as csv.
I'm pretty sure it won't affect any rows in the raw database, but before I run it in the actual database, I just wanted to make sure it's safe.
Here is what the Query will look like
WHEN OrderID = 10248 OR OrderID = 10250 THEN Quantity*-1
END AS NewQty
WHERE OrderID <> 10249 AND OrderID <> 10251
Note I changed the column names etc. to match w3 sql sandbox i.e. https://www.w3schools.com/sql/trymysql.asp?filename=trysql_case I will just change the column names to match the actual SQL server column names before running the query if you guys can confirm that this won't affect any rows or columns.
- This topic was modified 2 years, 1 month ago by Imrans23.