just show not repeated value – Mysql
This is my table id c_id number 3444 34 3377752 3446 35 3473747 3447 35 3532061 3454 37 3379243 3455 38 3464467 3456 38 3377493 I want to create a table which is show me not repeated value in a…
This is my table id c_id number 3444 34 3377752 3446 35 3473747 3447 35 3532061 3454 37 3379243 3455 38 3464467 3456 38 3377493 I want to create a table which is show me not repeated value in a…
PostgreSQL 15.0 I want to make a query that concats two different columns into one. Desired outcome I showed in the exapmle (it's not a real one but it would be useful to understand on this example). I've used CONCAT…
Let's say I have a table: name number date name1 91104 '2022-12-01' name2 11161 '2022-12-02' I am writing these queries: select count(name) from table where created_at between '2022-12-01' and '2022-12-10' and terminal_id like '911%' select count(name) from table where created_at…
Artist Points Notorious BIG 34 Notorious BIG feat. blah blah 42 2pac 20 2pac feat. Dr. Dre 30 I would like to group and sum by Artist for a table to look like so: Artist Points Notorious BIG 76 2pac…
I'm starting learn Go and SQL. I tryed to make initial migration using golang-migrate in my go project. Database is postgresql This is migration file: CREATE TABLE users ( id serial not null unique, name varchar(255) not null, username varchar(255)…
I have 2 tables arh and ar .I need to delete records from arh table for each accountMappingId where actionRequestId is <= maximum actionRequestId for the operation 'RESTORE' on the equivalent mappingId in ar table. The records should be deleted…
My existing SQL looks like the below, it will generate only the total_pending_req count. SELECT count(table1.employee_code) as total_requests, table1.employee_code as emp_code FROM table1 WHERE employee_status = 'PENDING' GROUP BY emp_code UNION ALL SELECT count(table2.employee_code) as total_requests, table2.employee_code as emp_code FROM…
I have this query in Postgres: Select "Charges"."saleAmount", "Charges"."buyAmount", "Operations"."id" From "Charges" Left Join "Operations" On "Operations"."id" = "Charges"."operationsId" Order By "Operations"."id" saleAmount buyAmount id 200 NULL id1 300 500 id2 0 100 id3 I need to transform it: Add…
when i am trying to create postgres database with bash terminal on windows 11, im using below commands; createdb 'test' or createdb -U postgres 'test' and nothing happens. i added the bin folder to paths in "environment variables" of windows.…
Hello I am kinda new to sql. Just wanna know if this is possible via sql: Table: (Multiple values are in just 1 cell.) COLUMN 1 COLUMN 2 "2023-01-01", "2023-01-02", "2023-01-03" "User A, User B, User C" Needed Output: COLUMN…