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 :: create table like another table 
Sql :: alter table add foreign key mariadb example 
Sql :: PL SQL VARRAY of records 
Sql :: uppercase sql 
Sql :: sql select date add day 
Sql :: sql count how many times a value appears 
Sql :: sql update multiple rows 
Sql :: postgres order by month 
Sql :: sql query to check if column contains alphabets 
Sql :: clear table sql 
Sql :: download sql server for mac 
Sql :: sql server create database 
Sql :: reset keys in sql 
Sql :: delete from IN subquery 
Sql :: import data from csv to sql server 
Sql :: Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000. 
Sql :: timestamp difference sql 
Sql :: json_value oracle 
Sql :: sql order by two columns 
Sql :: mysql create table index 
Sql :: soql user profile 
Sql :: update table sql multiple set 
Sql :: mysql group concat 
Sql :: insert select 
Sql :: delete table cassandra 
Sql :: mysql delete from where like 
Sql :: mysql find max value row 
Sql :: mysql 5.6 hierarchical recursive query 
Sql :: inner join mysql 
Sql :: distinct in sql 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =