Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

postgresql distinct

SELECT
	DISTINCT bcolor
FROM
	distinct_demo
ORDER BY
	bcolor;
Comment

select distinct postgres

-- NOTE: SELECT DISTINCT ON expressions must match initial ORDER BY expressions


SELECT
   DISTINCT ON (column1) column_alias,
   column2
FROM
   table_name
ORDER BY
   column1,
   column2;
Code language: SQL (Structured Query Language) (sql)

-- EXAMPLE
SELECT
   DISTINCT on (client_id) client_id, id
FROM
   public.dw_client_plan_histories
   where operation = 4
        and original_created_at >= '2022-06-17';
Comment

get distinct elements in table psql

postgres=#  select distinct on (col1) col1,col2,col3 from test order by col1;

 col1 | col2 |    col3    

------+------+------------

    1 | abc  | 2015-09-10

    2 | xyz  | 2015-09-13

    3 | tcs   | 2015-01-15

(3 rows)
Comment

PREVIOUS NEXT
Code Example
Typescript :: Scripts cannot be executed on this system. 
Typescript :: how to parameterize test cases 
Typescript :: print array elements with space c++ 
Typescript :: file reader with promise 
Typescript :: rest parameters in typescript 
Typescript :: conventional commits cheat sheet 
Typescript :: bits required for address 1 GB memory 
Typescript :: pass command line arguments with spaces cmd 
Typescript :: typescript number to hex string 
Typescript :: data type of stack in c 
Typescript :: switch in typescript 
Typescript :: Push Type Typescript 
Typescript :: get number of digits in an integer python without converting to string 
Typescript :: grid implementation html canvas 
Typescript :: mui styled typescript 
Typescript :: paginator 
Typescript :: linux bash scripts tutorial 
Typescript :: how to delete particular user in angular 8 
Typescript :: typescript Identical Types 
Typescript :: Custom Error Message Class 
Typescript :: angular services status return 400 response 
Typescript :: sql concepts interview questions 
Typescript :: the benefits of deploying a network using a WLC 
Typescript :: nullable parameter typescript 
Typescript :: typescript ! 
Typescript :: Why you do not set the state directly in React. For example, if you have const [products, setProducts] = useState([]). Why you do not set products = [...] instead, you use the setProducts 
Typescript :: are flights still running 
Typescript :: facade design pattern typescript 
Typescript :: phase on load complete 
Typescript :: This method can provide higher level of accuarcy in cost estimation based on the given historical data 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =