Just in case it is useful to someone else. I just figured it out from elsewhere:
WITH MyCte AS
(
select employee_id,
RowNum = row_number() OVER (ORDER BY (SELECT 0))
from V_EMPLOYEE
ORDER BY Employee_ID
)
SELECT employee_id
FROM MyCte
WHERE RowNum > 0
Related Contents:
- Reset identity seed after deleting records in SQL Server
- Solutions for INSERT OR UPDATE on SQL Server
- How to replace a string in a SQL Server Table Column
- T-SQL Cast versus Convert
- Altering column size in SQL Server
- Why do you create a View in a database?
- How do I list all the columns in a table?
- Correct use of transactions in SQL Server
- What does ON [PRIMARY] mean?
- SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints
- What’s the best practice for primary keys in tables? [closed]
- Need to list all triggers in SQL Server database with table name and table’s schema
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- How to see query history in SQL Server Management Studio
- What is best tool to compare two SQL Server databases (schema and data)? [duplicate]
- The object ‘DF__*’ is dependent on column ‘*’ – Changing int to double
- How to check which locks are held on a table
- How can I check if a View exists in a Database?
- The backend version is not supported to design database diagrams or tables
- How can I schedule a job to run a SQL query daily?
- Favourite performance tuning tricks [closed]
- Querying data by joining two tables in two database on different servers
- How do I change db schema to dbo
- SQL Server Script to create a new user
- SQL Server: Get data for only the past year
- Export database schema into SQL file
- How to select bottom most rows?
- How to get current instance name from T-SQL
- Relationship of Primary Key and Clustered Index
- INSERT vs INSERT INTO
- How to rethrow the same exception in SQL Server
- Functions vs Stored Procedures
- The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions
- Simple check for SELECT query empty result
- How to select data of a table from another database in SQL Server?
- Composite Primary key vs additional “ID” column?
- What is the syntax meaning of RAISERROR()
- Generate a resultset of incrementing dates in TSQL
- Logging ALL Queries on a SQL Server 2008 Express Database?
- Know relationships between all the tables of database in SQL Server
- What does =* mean?
- SQL Server giving logins(users) db_owner access to database
- Is it good database design to have admin users in the same table as front-end users?
- SQL Server 2008 R2 Stuck in Single User Mode
- How can I do a BEFORE UPDATED trigger with sql server?
- Change primary key column in SQL Server
- Add non-nullable columns to an existing table in SQL server?
- What is the difference between using a cross join and putting a comma between the two tables?
- Database-wide unique-yet-simple identifiers in SQL Server
- How to run a stored procedure in sql server every hour?