Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of 1
1 answer
83 views

This is the smallest alarm-threshold lookup I can reproduce: CREATE DATABASE alarm_thresholds; USE alarm_thresholds; CREATE TABLE limits(station STRING TAG, threshold INT32 FIELD); INSERT INTO limits(...
Score of -3
1 answer
100 views

Let's suppose I have this model: TableA ( Col1 int, Col2 int, Col3 int, Primary key (Col1, Col2) ) TableB ( Id int, Col1 int ) TableC ( Id int, SubId int, Col2 int, Primary key (Id, SubId), ...
Score of 2
2 answers
151 views

I am trying to extract the largest used serial numbers from a table of multiple products. The numbers are stored as varchar(50). One of the serial numbers includes a letter P suffix, so I use this to ...
Score of 0
1 answer
149 views

My script: -- DROP TABLE IF EXISTS test; CREATE TABLE IF NOT EXISTS test ( id smallserial, date_pr date, num smallint, naim text, pr numeric(19,4), txt text, CONSTRAINT ...
Score of 1
2 answers
185 views

I have a stored procedure in SQL Server, which is query a row based table. SELECT csd.* FROM MyData csd INNER JOIN #AttributeIds id ON csd.DataAttributeId = id.ResidentialAttributeTypeId WHERE 1 = 1 ...
Score of -1
3 answers
214 views

I would like a generic way, either in the tool of in SQL to show only non-NULL values in my results. In the example below select * from inventory.element, I would like a way to hide clei, description, ...
Score of 3
1 answer
207 views

The goal is to find a way to return no columns for an arbitrary SQL query. Rationale: curiosity; it should not be possible by definition. By "no column(s)" it means zero columns (no constant,...
Score of 1
2 answers
216 views

I want to verify the correctness of the data inside a junction table. Here's a minimal example - table Products: Id EnglishName 1 Drill 4 2 Light Switch 48 Table Suppliers: Id EnglishName 1 Bosch 2 ...
Score of 2
1 answer
290 views

In Apache IoTDB 1.3.7, why does adding ORDER BY time DESC cause the query to return no data? This query returns data: SELECT * FROM root.iot_prod_2.p.cjzxjd.t0020.ori WHERE time >= 1791625620000 ...
Score of -1
7 answers
311 views

How do I select the ID's that have only the colour 'Red' and no other colour: ID Colour 1 Red 3 Blue 2 Red 4 Red 1 Yellow I am trying to write a SQL WHERE clause that returns only IDs coinciding with ...
Score of 2
1 answer
230 views

Normally, whenever I have a table that has a column with values that are rarely different from a default value, I create another table that defines that column and references the original table, so as ...
Score of 1
2 answers
152 views

I have created two separate temporary tables for ticket and sales per TPM using SQL Server. For tickets: select * into #pivotticket from (select [month], [ID],[TPM], [day], [Tickets] from #...
Score of 2
3 answers
238 views

I populate my table original from a CSV file and generate a 1-column primary key: CREATE TABLE original ( value real, unit varchar ); COPY original FROM 'projections.csv' WITH DELIMITER ',' ...
Score of -10
2 answers
191 views

When writing a query, in what situation would I use CONCAT?
Score of 16
1 answer
1032 views

I noticed that a certain view did not behave correctly when called within a NOT EXISTS and found out that the same view returns a row on this contradictory query, even though one would expect that ...

15 30 50 per page
1
2 3 4 5
…
44896