Search
 
SCRIPT & CODE EXAMPLE
 

SQL

odd record sql query

SELECT EmpID FROM (SELECT rowno, EmpID from EmployeeInfo) WHERE MOD(rowno,2)=0;
Comment

select odd records sql

SELECT t.First, t.Last
FROM (
    SELECT *, Row_Number() OVER(ORDER BY First, Last) AS RowNumber 
            --Row_Number() starts with 1
    FROM Table1
) t
WHERE t.RowNumber % 2 = 0 --Even
--WHERE t.RowNumber % 2 = 1 --Odd
Comment

PREVIOUS NEXT
Code Example
Sql :: Assign value to variable inside Dynamic SQL 
Sql :: mysql not empty 
Sql :: Add new column T-SQL 
Sql :: len sql 
Sql :: remove last characters in mysql 
Sql :: how to get specific salary in sql 
Sql :: database get 10 user aleatory 
Sql :: sql inner join 
Sql :: mysql add hours to time field 
Sql :: sql select all tables from database change url 
Sql :: creating a view in sql 
Sql :: change from not null postgresql 
Sql :: mysql updating multiple column values from array variable 
Sql :: psql check if value in array 
Sql :: forcefully delete a row in mysql which has references 
Sql :: mysql alter table add column 
Sql :: 1422: Explicit or implicit commit is not allowed in stored function or trigger 
Sql :: how to filter repeated same result using sql query 
Sql :: rebuild index sql server 
Sql :: order by sql query 
Sql :: nested select sql 
Sql :: how to move a column to different spot mysql 
Sql :: sql max min 
Sql :: date format in oracle 
Sql :: Select All From A Table In A MySQL Database 
Sql :: find the all the constraints in a specific table 
Sql :: view acl table oracle 
Sql :: if role exists sql 
Sql :: mssql coalesce 
Sql :: difference in dates sql 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =