Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql finding longest and shortest names in a fleld

# IN the example below, "CITY" is the filed, "STATION" is the Table
(SELECT CITY, LENGTH(CITY)
FROM STATION
ORDER BY LENGTH(CITY) ASC, CITY ASC LIMIT 1)
UNION
(SELECT CITY, LENGTH(CITY)
FROM STATION
ORDER BY 
LENGTH(CITY) DESC, CITY DESC LIMIT 1)
Comment

PREVIOUS NEXT
Code Example
Sql :: sql disable trigger 
Sql :: stop mysql 
Sql :: forgot mysql root password stackoverflow 
Sql :: check timezone of mysql database 
Sql :: mysql where column not integer 
Sql :: oracle sql limit results 
Sql :: put line oracle 
Sql :: alter table column change data type to text mysql 
Sql :: get tables in database sql 
Sql :: stpop start psql server 
Sql :: sql add column 
Sql :: list tables sqlite 
Sql :: oracle columns table 
Sql :: reset mysql root password mac 
Sql :: postgresql change column type 
Sql :: postgres regex remove special characters 
Sql :: how to start mysql 
Sql :: create table oracle 
Sql :: get the list of all tables in sql server 
Sql :: oracle turn off constraint 
Sql :: sqlite list columns 
Sql :: alter sequence postgres 
Sql :: psql view enum values 
Sql :: mysql loop insert 
Sql :: add column in mysq 
Sql :: drop column if exists sql server 
Sql :: reset auto increment in sql 
Sql :: how to check database size mysql 
Sql :: psql autocomplete for mac brew install 
Sql :: dirinfo.name my snippets in stored procedure 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =