674,582 questions
0
votes
1
answer
76
views
Performing product operation on consecutive true segments in a vector
I have two vectors of equal length, one integer vector and one boolean vector. I want to calculate the product of elements in the integer vector where the corresponding boolean vector has consecutive ...
Best practices
1
vote
1
replies
29
views
How do I design an ERD and SQL schema for a basic banking system (accounts & transactions)?
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 ...
-6
votes
1
answer
47
views
BigQuery: How to replace 0 values with NULL in a column?
I’m trying to clean a BigQuery weather dataset where missing values were entered as 0. My UPDATE query to replace 0 with NULL is throwing an error. How can I correctly convert these zeroes to null ...
-3
votes
0
answers
41
views
SQL subquery issue [closed]
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 ...
1
vote
1
answer
9k
views
MMC could not create the snap-in. SQL Server configuration manager error
When i tried to connect to sql server configuration manager in sql server 2008. It shows error MMC could not create the snap-in.
It was working perfectly till last night. What can be the reason, how ...
0
votes
2
answers
4k
views
Call BigQuery Stored Procedure by naming parameters
I have a BigQuery stored procedure that is defined like this:
CREATE OR REPLACE PROCEDURE proc_name(
param_1 INT64,
param_2 INT64,
param_3 DATE
)
BEGIN
//CODE
END
When I call the ...
0
votes
1
answer
10k
views
To Use Pivot Table as View in SQL Server
I have a pivot table that I prepared in SQL, but I can't use it in View. I'm using SQL Server 2008.
0
votes
3
answers
1k
views
How to avoid duplicate values in SQL Server
I have almost 10 token machines where customers are getting token numbers from table Token. I am using a stored procedure for accessing this table and updating it
Id Name TokenFrom TokenTo ...
0
votes
1
answer
46
views
Trigger on PostgreSQL updating salary column
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 ...
-2
votes
0
answers
58
views
How can I join two tables on different columns? [duplicate]
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'...
1
vote
1
answer
352
views
Parsing XML in teradata
I have this requirement where I am trying to build SQL queries on teradata and pull XML attributes/element data.
The dataset I am working on is a swift iso payment xmlsnlike PAC04,PACS08,etc.
I looked ...
4
votes
2
answers
2k
views
automated check if two SQL queries are semantically equal
I got two queries:
'UPDATE foo SET bar = baz WHERE a = b AND c = d'
and
'UPDATE foo SET bar = baz WHERE c = d AND a = b'
both are semantically equal (they do the same), but a simple compare would ...
-1
votes
1
answer
71
views
Showing exclusively the biggest value [duplicate]
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, ...
1
vote
1
answer
210
views
How to display a Grafana dashboard with time series, on MONTH?
From a data source on Google Cloud, with a table that contains 2 columns:
Month (DATE)
Cost (NUMERIC)
The query:
SELECT *
FROM (
SELECT
Month
,cost
FROM
MyTable
ORDER BY 1 ASC
)
My ...
-2
votes
1
answer
70
views
What is the correct syntax for using the Lead Function in SQL Anywhere [closed]
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, ...