Questions tagged [sql]

Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.

0 votes
0 answers
7 views

Trying to pull a record from my database that has spaces in its content

I got a website and I'm trying to pull out data that contains a space in it. So on this page it shows certain cars, so it would say 2016 Toyota SFR Racing. The year and the model name is stored in one ...
user avatar
0 votes
0 answers
18 views

SQL double group by

I need to select employees' names from those who has sold products, for the biggest total sum of money in each of the years, in Northwind database. I've managed to create a valid query like this: WITH ...
user avatar
0 votes
1 answer
8 views

How to iterate PYODBC variable multiple times?

I am querying a SQL Server table from Python like following: query = "SELECT PN, PD, VT FROM inpat" data = cursor.execute(query) Next, I am iterating data like following for i in data: ...
user avatar
1 vote
0 answers
29 views

SQL STUFF FOR XML with specific grouping

I'm working in SQL Server 2014, and I have the following simple data, which tracks calling history of users: PhoneNumber Activity ActivityDate ------------------------------------ 9075551234 ...
user avatar
1 vote
0 answers
23 views

Is it possible to write an SQL Condition where it compares the bp master address to the sales order address to give an error? SAP BUSINESS ONE

A more detailed version of the question is that in the B1 Validation Configuration, is there such a way for a sql condition if the sales order ship to address is not the same as the bp master data ...
user avatar
0 votes
0 answers
18 views

Getting date wise employee report in Oracle 12c

I have table like this: Now I want output like this: On 19/08/2022 ADAM works for 3 Locations. So I need to show 3. Simply I can get it with count(*). But the main challenge I am facing that is ...
user avatar
0 votes
1 answer
14 views

select node value from json column type

A table I called raw_data with three columns: ID, timestamp, payload, the column paylod is a json type having values such as: { "data": { "author_id": "...
user avatar
  • 2,807
0 votes
0 answers
17 views

BigQuery finding sessions that have visited both pageA (contains keyword "main") and pageB (contains keyword "side")

On BQ I'm trying to find sessions that have visited both pageA (URL contains keyword "main") and pageB (URL contains keyword "side"), and the pages that session visited. Here is my ...
user avatar
  • 45
0 votes
3 answers
31 views

PostgreSQL generate and increment alphanumeric series

as the question says, I need postgresql procedure which will generate Some ids like: AX0 AX1 AX2 . . AX9 AXA AXB . . AXZ AY0 AY1 . . AY9 AYA AYB . . AZZ B00 B01 B02 . . etc And the proceedure can ...
user avatar
0 votes
0 answers
15 views

Beginner SQL / Dune Analytics

I've been playing around with Dune Analytics but can't seem to get this to work! I've managed to filter a wallet to display the transactions showing the number of tokens sold and the corresponding BNB ...
user avatar
-2 votes
0 answers
21 views

Can't select from two tables in sql and C#

I am using the following query to select columns from one table and brandname from another table where id=srhcid.Text. CmdString = "SELECT purchases.name, purchases.size, purchases.pack, ...
user avatar
0 votes
0 answers
26 views

is there any sql command that lists the fields and counts how many times it appears in the table?

I want to list the person's name and beside how many times this person got a 10. Is there any command like this? marcus gold 25 julia silver 34 jason platinium 12 sarah bronze 45
user avatar
0 votes
1 answer
21 views

PostgreSQL Multiple Queries in one statement can be done parallel

I have created a application which is sending queries using DBLink from many tenant-databases to a single group-database. An example of a query is the following: INSERT INTO public.<tableA> (<...
user avatar
0 votes
1 answer
22 views

Evalaute Oracle Table to Calulate or Extend Multiple Date Ranges into One Period

I have a table that shows date ranges of an object. For reference The object needs some sort of event in order to prevent it from expiring. We have a rule where we can apply a protection against the ...
user avatar
  • 3,853
0 votes
1 answer
33 views

Row number with condition

I want to increase the row number of a partition based on a condition. This question refers to the same problem, but in my case, the column I want to condition on is another window function. I want to ...
user avatar
  • 4,673

15 30 50 per page
1
2 3 4 5
42665