I’m experimenting with keeping values like the following in a Postgres jsonb field in Postgres 9.4: I’m executing queries like: How would I create an index on that data for queries like the above to utilize? Does this sound reasonable design for a few million rows that each contain ~10 events in t…
Tag: sql
Incorrect syntax near the keyword ‘Table’ C# SQL [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 7 years ago. Improve this question Hello I’m trying to figure out why i have this error Incorrect …
sqlite count of distinct occurrences
What is the best way of writing a sqlite query that will count the occurrences of colC after selecting distinct colA’s ? SELECT colA, colB, colC FROM myTable WHERE colA IN (‘121’, ‘122’,’123′,’124′,’…
MySQL/MariaDB – order by inside subquery
I used the following query with MySQL 5.5 (or previous versions) for years without any problems: SELECT t2.Code from (select Country.Code from Country order by Country.Code desc ) AS t2; The order …
linq to entities query which has multiple where clause and one where clause with where in condition
I’m trying to build a linq to entities query. This is what I have so far: from x in db.BusSchedule join y in db.BusSchedule on x.ID equals y.ID – 1 where Convert….
Huge performance difference between two similar SQL queries
I have two SQL queries that provides the same output. My first intuition was to use this: Now, this took something like 70 secs to complete! Searching for another solution I tried something similar: Surprisingly, this took 0.05 secs to complete!!! how come these two are so different? thanks! Answer First thin…
Escape single quote in sql query c#
Here I have this method in my CandidateOp class file. I’m passing the ComboBox text in the form and I am getting the ID to the integer type variable tempPrID. The partyIDtoInsert, is a stored procedure I have created and it is being called in the method getpartyID as shown before, to get the id of unite…
QC: Get folder structure with test set and cases along with their pass or fail status
I need some directions on how to approach this… I have a folder structure in QC like the one I attached in this screenshot: I want the result in below format All along I have been using the cross filter in standard report using Test Instance type. I was able to get the TestSetName, Test cases, Pass or F…
PHP fails to insert into Mysql (auto increment)
I have made my Mysql Table link this: That problem occurs because i am not able to insert auto_increment into my mysql query. index.php I post to it by a HTML form and it does executes the query but i get no rows in that table. I thnk its because of auto_increment or Unique or Primary. i was told to
Default row order in SELECT query – SQL Server 2008 vs SQL 2012
Our team recently upgraded our databases from SQL Server 2008 to SQL Server 2012. One breaking change we noticed was in the default order of rows returned by the SELECT statement, i.e. when an explicit ORDER BY clause is not specified. As per MSDN, SQL Server 2012 does not gaurantee the order of the rows retu…