Skip to main content

Questions tagged [query]

Writing queries to request or change information stored in a database or other information management system. Questions should include table and index definitions, sample data, expected output, and a tag for the specific system (e.g. MySQL, PostgreSQL, Oracle, SQL Server, MongoDB).

0 votes
2 answers
58 views

I have a table with below structure: create table TEST_REFUND_CASHOUT ( f_gdate DATE, trackingcode VARCHAR2(4000), cashout_trackingcode VARCHAR2(4000), cashout_date ...
Pantea's user avatar
  • 1,502
0 votes
0 answers
54 views

We have observed an unusual CPU behavior on our SQL Server 2022 (Core Edition) starting from a specific date. The issue is that a few specific CPU cores — particularly cores 1, 7, 14, and 21 — ...
Mohammad Safyar's user avatar
0 votes
0 answers
28 views

Apologies if this is a basic question, but my google isn't googling, and SQL is not my strongest point. I'm trying to create a table output in SQL where the headings and rows are dynamic. I'm trying ...
TonyC's user avatar
  • 1
3 votes
1 answer
188 views

I have these two queries in Postgres. One is: SELECT _id, created_at FROM pedidos WHERE _id = '123abc; Works fine, returns: { "_id": "123abc", "created_at": &...
flourigh's user avatar
  • 145
0 votes
2 answers
105 views

In Postgres I'm trying to automatize the creation of a non-existing db-user (using it in Debian's postinst script) in the following way: SELECT 'CREATE USER :v1' WHERE NOT EXISTS (SELECT FROM pg_user ...
Paule's user avatar
  • 3
1 vote
2 answers
93 views

We have a dataset with "visits & events" with their "frequency". Sample data looks like this: DROP TABLE IF EXISTS dbo.EventMetrics GO -- -- Create table with sample dataset -- ...
ToC's user avatar
  • 727
1 vote
0 answers
83 views

Getting the referenced columns from a view that references data to it's own database if pretty straightforward with the INFORMATION_SCHEMA.VIEW_COLUMN_USAGE-tables but I'm struggling with getting the ...
chittybang's user avatar
2 votes
2 answers
67 views

I have many queries that return some statistical data on a subject in various tables. The result includes a "classification" that is one of {"C","P","M"}. I ...
Adam Ant's user avatar
0 votes
1 answer
56 views

300k+ videos 10+ millions of markers, pointing to timeranges in videos { "markerCategory": "something", "markerDesc": "something-more-specific", "...
gherkins's user avatar
  • 103
0 votes
1 answer
64 views

I have a history table, I want to create another view to pick relevant records from this history. Not all records are relevant. I'm after the record changes for certain columns, for this case I care ...
nrod88's user avatar
  • 1
0 votes
1 answer
108 views

I am very new to MongoDB and have just started learning and working with it. I have a question about a query. This is the query: db.getCollection("user_plates").count( { "...
Pantea's user avatar
  • 1,502
0 votes
1 answer
74 views

I have a table with below structure: create table test_table (queuename number, duration_sum number, rating_sum number, rating_avg number, rating_cnt number ) Here is the sample data: ...
Pantea's user avatar
  • 1,502
3 votes
2 answers
465 views

I have a fact table that contains sick leave values for employees (Table 1) and I need to slot each value into one of the bands (Table 2) The problem is that the fact table contains some negative ...
Annette's user avatar
  • 33
0 votes
2 answers
76 views

When running a query in SQL Server Management Studio, is it then possible to guarantee that the script will only target the designated database? When I select a database, that's fine and good and all -...
Morten Worm Due's user avatar
1 vote
2 answers
90 views

We have a #ValidCode table with list of valid codes like: 'A', 'B', 'C', etc. Another table called #SourceData with input data -- that comes as a combination of valid and invalid tokens (sometimes ...
ToC's user avatar
  • 727

15 30 50 per page
1
2 3 4 5
106