I have a “user” table with two entries. For some reason, the query “SELECT login, password FROM user WHERE login = ‘login’” returns two records. Any help, please. Answer I assume that your query is actually using double-quotes for your string ‘login’ instead of single…
How to obtain summary summation when GROUP BY is not working?
I have data with the columns User_id (char) filename (char) filesize (numeric) Every user_id has more than 5 files to it’s name, of different filesize values. Problem statement: I want to have a summary of this table, with columns, User_id, Filesize, where it shows the total size occupied by each user i…
Merge, Combine, Join 2 different rows in 1 single row Google SQL | Big Query
I have the following table: I’m using this query to get the above result: However, I would like to combine both rows in a single one, something like this: How am I able to output this in Google SQL? I’m new to SQL world, happy if you could help me out 🙂 Thanks in advance for the assistance. Answer…
Postgres add identity results in ERROR START value (0) cannot be less than MINVALUE (1)
Tried to run this because I want the auto generated IDs to start at 0 and got error: START value (0) cannot be less than MINVALUE (1) I’m not good at PostgreSQL yet so not sure how to get it to increment starting at 0. Answer All Identity columns create a sequence in the backend. In your sequence_option…
F# Query Exception, “unrecognized method call value”
Q: What does the following exception mean? I’m attempting to translate a Pervasive SQL query to an F# query using SqlDataProvider with an ODBC connection, building up slowly bit by bit. I’m getting an exception with the following query with a somewhat cryptic exception. When the printfn statement …
Best way to find cancel and substitute match from the table
I have a table which has all order information. Id is the unique key for the table and it’s grouped by Order_Id (every order for the same product has the same Order_Id). The main thing is that if order is cancelled, it is recorded as a cancelled order (Cancelled? = True) and for following orders, it mus…
For each period I need to sum the period and previous periods
I need help creating a query . I want to group by Period and Jobid. For each grouping I need to sum the hourworkedtotal for each period. This value will also include any periods prior to this period. …
Rolling Sum for Last 12 Months in SQL
I’m trying to get the rolling sum for the past 12 months (Oct 2019-Sept 2020, etc.)> So far, I figured out to get the current year total (which I also want), however, I’m stuck on a legit 12 month rolling sum. here’s what my current output looks like AS you can see, it resets at the begin…
How to natural sort “X-Y” string data, first by X and then by Y?
Given this data: I’ve tried several of the common natural sorting methods for mysql, but they won’t sort these in a natural descending way, like: For example: Answer Assuming the parts on either side of the – are limited to 2 digits and 5 digits respectively, you can extract the two numeric …
Name and birthdate for all the students whose first name is between 6 and 9 characters long
CREATE TABLE USER ( [UserID] [FirstName] [LastName] [BirthDate] Birthdate for all the students whose first name is between 3 and 5 characters long, and whose last name is longer …