Skip to main content
-3 votes
0 answers
41 views

enter image description here (SQL subquery problem) enter image description here (SQL subquery problem) See the same result came without using the subquery. So why should I use this complicated ...
Saiful Islam's user avatar
Best practices
1 vote
1 replies
29 views

I'm working on a small educational project: building a simple banking system that includes customers, accounts, and transactions. I have read about ERD modeling but I'm not sure how to properly ...
vane's user avatar
  • 1
0 votes
1 answer
46 views

I am having some troubles setting a trigger in PostgreSQL. I have a table Employees with columns such as employee_id, salary and hourly_pay. The salary is annual, so I'd like to change the salary when ...
Lucca Paz's user avatar
-2 votes
0 answers
58 views

I have two tables; the first one consists of clients' names and their id. For example: name surname1 519651 name surname2 496879 name surname3 848465 The second one consists of clients'...
solar dary's user avatar
-1 votes
1 answer
70 views

I've been tasked with finding the client with the highest sum of payments, the table they gave me contains the customer number and amount, I have not been able to do this, SELECT suma.customerNumber, ...
Franco Zavala Morgan's user avatar
-4 votes
1 answer
82 views

Let's say I have table A and table B table A has one column A, comprised of 4 values A 1 2 3 4 table B also has one column, called B, comprised of 13 values B 1 2 3 4 5 6 7 8 9 10 11 12 13 Now, ...
Trovs OnEmu's user avatar
0 votes
0 answers
110 views

Table has index on name column: CREATE TABLE firma2.klient ( kood character(12) primary key, nimi character(100), ... ); CREATE INDEX IF NOT EXISTS ...
Andrus's user avatar
  • 28.2k
1 vote
2 answers
102 views

I tried this code: CREATE OR REPLACE FUNCTION public.t4(in iid int, OUT n1 text, OUT n2 text) LANGUAGE plpgsql AS $function$ BEGIN SELECT DISTINCT n1=l.name, n2=l.comment from ...
Yarr's user avatar
  • 47
Best practices
0 votes
7 replies
94 views

I have a PHP + MySQL project where I need to generate sequential transaction IDs. Each transaction can have multiple items, so all rows for that transaction must share the same txn_in value. Tables ...
Developer Account's user avatar
Advice
0 votes
2 replies
60 views

I have a query with join. When Trino has 10 workers it works. When 5 - it fails. As I understand the situation (Trino call this DistributedHashJoon) - it splits entire table into 10 pieces, so smaller ...
Cherry's user avatar
  • 34k
-4 votes
1 answer
80 views

Let's say I have a table named People with a column PeopleID. I have another table Payment. Each row in this table has 3 columns: PeopleId, Amount, Date The date is always the fist day of the month. ...
mlwacosmos's user avatar
  • 4,561
1 vote
2 answers
101 views

I am trying to convert the string date type that retrieved from a column. Below is the scenario #input date_str 02/08/24 21/09/2023 25.02.16 null null I need to convert above column into a new ...
AdhiHari's user avatar
-2 votes
1 answer
70 views

Handbook: LEAD (value_expr) [, offset [, default]]) OVER ([PARTITION BY window partition] ORDER BY window ordering) This could not be right. My code looks like that: SELECT LEAD(tbl6.StartTime, 1, ...
Christian's user avatar
0 votes
2 answers
154 views

I have a query that outputs the below result: users file_consumed John orders Martin orders Alice orders Bob payments Alex payments Julie payments John deliveries Bob deliveries I want to convert this ...
LearneR's user avatar
  • 2,591
0 votes
2 answers
127 views

I have a table with data structured like this. Each product ID has a list of element IDs--for each element, there is a dictionary including a list of elements and their assigned IDs. Not every element ...
Tyler Moore's user avatar

15 30 50 per page
1
2 3 4 5
44973