I have the following LINQ statement: Which uses the repository pattern. The search function is the one below: When I inspect the command that arrives in SQL Server I see that the query is translated in the following SQL: It works perfectly, but why there is an inner join duplicated: is a non-sense to me! If I…
Tag: sql
Retrieve substring of a column name, then apply them to corresponding column data? SQL
I have a table with, let’s say, 13 columns. I need to take a part of the column name and apply it to the corresponding data in two columns. Example of what I start with: Class Result01 Result02 …
How to select data from day by day with special time?
I want to select data day by day. Condition: data will be cut the day from 10:00 pm to tomorrow 10 pm. For example: | REGTIME | T8 | T9 | T10 | | 2008-12-03 | 879 | 785| 542 | | 2008-12-04 | 556 | …
DATE_DIFF() in BigQuery to calculate time between rows
I would like to calculate the time delay between several customer purchases. However, each purchase is saved in an individual row. The data set looks similar to the following: customer | order_id | …
What is the best way to pass in authenticated user information to a sql query?
My web application uses a table users, posts and votes, where a user can create a post and the votes table contains single votes made by some user on some post (think of Hackernews or Reddit). When …
Adding a dot in a string in sql
I need to add a dot in two strings of numbers. (example “88188741478”). I need to add it 8 characters before the end. The result should look like this “881.88741478”. I need …
Insert query returns error : SQL Error: ORA-01861: literal does not match format string
I have this simple enough insert query but i have no idea why it is returning an error. i can see the error comes from the row Birthay, if i remove it the insert is done ok. My query: INSERT INTO …
Hackerrank SQL problem to solve in Oracle’s SQL version
Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest or largest …
Adding text and image to database with C# and SQL
The following windows form application takes an input for name, age, gender, description, and an image. However when clicking the “Save Information” button the following exception error …
Should the column used to order results be included in the index of a postgresql table?
I am creating indexes for a PostgreSQL database. I would like to know whether the column(s) used to order results in a PostgreSQL statement should be included in the index. Assume I have created a …