Questions tagged [sql]
Sebastian Wright
Ask Question
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.
633,753 questions 7- Bountied 7
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
Make a multiple INSERT based on checkboxes and using the id
So I was trying to make a multiple insert based on checkboxes, I have this table Table photo. This is my input: <td><input type="checkbox" name="checkbox[<?php echo $... php sql checkbox insert- 1
Sorting columns in a sql view results in different performance
I have a problem with sorting results in a sql view, when I sort by one of the columns which is nvarchar it sorts fine and quick when I sort by other column which is also coming from the same table as ... sql sql-server tsql view sql-view- 1
SQL Query Running Slow I need help optimizing it to improve performance
I have this SQL Query, it is running really slow, I need to improve the performance of it, any advise would be helpful. SQL Query BELOW: SELECT DISTINCT(b.projid),a.Id,a.Company,a.ProjectType, a.... sql performance optimization- 1
Postgres Average Filter based on date
I am having a postgres table which is updated by a cron for every hour. I need average of that volume based on 1 day, 5 day, 10 day. when i average it like this select avg(volume), id from price_table ... sql postgresql group-by- 21
How to link a server to an ODBC Dsn requiring a password, in SQL Server
I have an ODBC driver that I would like to use as a linked server in SQL Server, the problem is it requires a password. I can connect to the DSN in a c# application like this: OdbcConnection conn = ... sql .net sql-server odbc- 1
How can I count the total no of row which is not containing some value in array field? It include null values as well
| names | | -----------------------------------| | null | | null | | [{name:'test'},{name:'test1'}] | | ... sql database google-bigquery count unnest- 285
Count Distinct IDs in a date range given a start and end time
I have a BigQuery table like this id start_date end_date location type 1 2022-01-01 2022-01-01 MO mobile 1 2022-01-01 2022-01-02 MO mobile 2 2022-01-02 2022-01-03 AZ laptop 3 2022-01-03 2022-01-... sql google-bigquery- 3,840
Alternative to UNION ALL
I want to get the below result without using UNION ALL as it is impacting the performance of the select query. I have 2 tables table1 and table2, I want to concatenate the values from the first ... sql sql-server tsql- 1
How can I merge this query so that it returns only one column?
I have the following table: Player Name Nationality Romelu Lukaku Beligian Christian Pulisic American Kai Havertz German Masoun Mount British Reece James British Edouard Mendy French N'Golo ... sql- 3
Toad Data Point Cross Connection Query / Unrecognized date time format
I am trying to filer this cross connection query by the date/time but keep getting a formatting error (AND BD.InspectDate >= '6/13/2022 12:00:00 AM'). I tried to convert to Date (AND convert(date, ... sql toad- 1
MERGE statement - Don't update OR insert when a condition is met between source and target
MERGE StudentTable as target USING MemberTable as source ON target.StudentGUID = source.MemberGUID WHEN MATCHED THEN UPDATE SET target.CourseId = source.CourseId, target.HomeCityId = ... sql sql-server tsql- 53
MS SQL Server Data Anonymise
I have a below requirement We are going to restore production database into UAT for testing few usecases. We should anonymise required data's (Ex: SSN, Credit Card etc) from all types of users ( ... sql security anonymize- 1
SQL Case Statement: Set the default value for an Case
this time I need an explanation for SQL. I have seen on the internet now nothing special and maybe I have a thinking error. I have a case statement and now I want to " filter " it in ... mysql sql oracle-sqldeveloper- 23
Measuring the averaged elapsed time for SQL code running in google BigQuery
As BigQuery is a shared resource, it is possible that one gets different values running the same code on BigQuery. OK one option that I always use is to turn off caching in Query Settings, Cache ... sql optimization google-bigquery- 83
PostgreSQL: Select latest entries only when values differ in a column
Imagine the data: id audit_id val updated_at 1 11 43 October 09, 2021, 07:55 AM 1 12 34 October 11, 2021, 11:03 PM 1 13 88 January 23, 2022, 01:... sql postgresql date partitioning- 717
15 30 50 per page12345…42251 Next