I have recently (today) started using SQL, I have absolutely no idea what I'm doing. I made a Query.sql
file and started to throw some random commands in. I highlight a SELECT
and execute it to see what happens, I add a new SELECT
, highlight it and see what that does.
However when I tried to create a view it had some problems. I don't really understand why but using a GO
before and after it seemed to solve the problem, but now when I do a select from that view, it does not recognize it (that being said, it works, but it's highlighted with red, usually that means it should not compile).
Could someone explain in layman's terms what's going on ? And how can I resolve the SELECT * FROM METRIC_STATS
issue ? (I tried encapsulating it in the same go, other goes, don't exactly know how it should even look like)
GO
CREATE VIEW METRIC_STATS ( ID, MONTH, TEMP_C, RAIN_C)
AS SELECT ID,
MONTH,
(TEMP_F - 32) * 5 /9,
RAIN_I * 0.3937
FROM STATS;
GO
SELECT * FROM METRIC_STATS;