Skip to content

Tag: sql-view

Find the first AND last date that an ID occured in dataset SQL

I have a very large data set with over 1 million rows and over 70 columns. The dataset contains data about back orders of an organization. Every day a snapshot is being made and all orders that are backorders are added to the dataset. I want to know what the first date is when an OrderID occurs in the dataset…

Can this be done as a SQL VIEW

I have a SQL Server table of Customer’s Events: There can be many EventTypes for the same customer in one day. EventTypes are like 1 – CheckIn 2 – CheckOut 3 – ExamStart 4 – ExamEnd Now I want to select Customers that are currently (today) on premises. That’s Clients who ha…

Creating a VIEW in SQL-Server

I’m trying to create a VIEW in my database, and it shows me “Incorrent syntax error” Am I doing something wrong? Answer Include GO between your Create View and Select query (or) view should be the only statement.