I’m woking on a simple chat app. It should allow users to run conversations user-to-user or in groups (multiple users). So here are my tables: table users ID | username | … table …
Is it possible to delete duplicate rows from a table without knowing it’s columns?
Is there a way to delete all the duplicate rows from an arbitrary table in a database when you don’t know the table’s structure (it’s columns) using only plain SQL (without using PL/SQL)? — The code …
Finding percentage on a sub-query with different where clauses
I am trying to find the percentage completed on a table with a sub-query. I can successfully get the value I need using the following, but I am concerned that I am unnecessarily using two queries to …
SQLDataReader does not show value of column with double colon in field name
A Select query works fine when I enter it in SQL Server Management Studio on SQL Server: SELECT [00:00] FROM MY_TABLE WHERE whatevercondition … The column name is “00:00” – it has a double …
Filter data from database with multiple user selections
Currently I’m developing a search form so my SQL query needs to change with user input. Please see the below code sample. $sqlSearch = “SELECT * FROM seafarers WHERE “; if ($dateS != “”) { $…
PostgreSQL – Subtraction based on column data simplifying query
I’m trying to subtract data from the table based on another column which represent their category. For example: +—-+——–+———-+ | ID | Amount | Category | +—-+——–+———-+ | 1 |…
Replicating functionality of excel cell referencing (or calculations over multiple views)
I have a table with 3 columns that contains a number of data streams all in one table. val_name is the name of the data stream, val_sequence is the incrementing sequence number and val contains the …
How to check if column has value if another column is populated in SQL Server?
I am trying to find a way to see if I can write a query to check a table to return any row that is missing a dependency if that makes sense. For example let’s say I have the following columns: …
ORA-00904: “PREV_TEMP”: invalid identifier with LAG function
Whats is wrong with this query? It returns: ORA-00904: “PREV_TEMP”: invalid identifier SELECT Id, RecordDate, Temperature, LAG(Temperature) OVER (ORDER BY RecordDate) as prev_temp FROM Weather …
Spring Data Insert Data when entry not yet exists
SCENARIO: I have a MySQL Database where I have one Table with a Mapping of a user and a product. My Application offers an api so I have to be aware that the mapping will not be done multiple times. Therefor I want to check if the two ids( of the user and the product) are already mapped. PROBLEM: I