Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
web source
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
CREATE TABLE tickets(id serial PRIMARY KEY, source text NOT NULL, user_id int NOT NULL, shop_id int NOT NULL, created_at time DEFAULT current_time); INSERT INTO tickets VALUES (0, 'web-mobile', 1, 2); INSERT INTO tickets VALUES (1, 'web-destkop', 1, 2); INSERT INTO tickets VALUES (2, 'web-destkop', 2, 2); SELECT shop_id, substring(source,1,3), COUNT(DISTINCT user_id) AS user_count FROM tickets WHERE shop_id = 2 GROUP BY shop_id, substring(source,1,3);
absolute service time: 0,53 sec
edit mode
|
history
shop_id
substring
user_count
1
2
web
2