Search
 
SCRIPT & CODE EXAMPLE
 

SQL

select first and last row sql

SELECT
  (SELECT * FROM tableName ORDER BY col1 LIMIT 1)        AS first,
  (SELECT * FROM tableName ORDER BY col1 DESC LIMIT 1)   AS last
;
Comment

PREVIOUS NEXT
Code Example
Sql :: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file 
Sql :: download mysql 64 bit 
Sql :: java string to sql timestamp 
Sql :: check duplicate values plsql 
Sql :: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client vs code 
Sql :: sql current timestamp table 
Sql :: CALCULATING MONTHS BETWEEN TWO DATES IN POSTGRESQL 
Sql :: database dump mysql command 
Sql :: mysql ip address 
Sql :: where id is in list sql 
Sql :: date conversion in mysql column 
Sql :: mysql isnull 
Sql :: sql insert multiple rows 
Sql :: sql any 
Sql :: connect mysql command line 
Sql :: how to check grants on a package in oracle 
Sql :: duplicate entry 
Sql :: sql list dates between two dates 
Sql :: mysql check if lowercase 
Sql :: mysql récupérer le code création de vue 
Sql :: oracle locked objects 
Sql :: SQL Greater Than or Equal to Operator 
Sql :: postgresql not case sensitive where in 
Sql :: list all tables in postgres 
Sql :: sql function to add all values round of 2 decimal places 
Sql :: sql value exists in column 
Sql :: mariadb date equals to current_date plus days 
Sql :: create scalar function in sql server 
Sql :: mysql drop key 
Sql :: object dependencies in oracle 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =