I’m not a database expert, but I’m curious about auto-incrementing in SQL. Is it efficient, a friend of mine, his opinions, he’s not using auto-incrementing instead he’s taking the last id every time …
Tag: sql
SQL Server Sum specific transaction type amounts
I have a temp table (#general) that contains Account number, transaction type, Amount info as below AccountNumber Tran_Type Credit 96551AQ6 TSCNYAEUQF 0.0000000 96551AQ6 TSCNYAEUQF …
Undefined variable: users (View: /home/laravel/web/laravel.swt101.eu/public_html/abonamenty/resources/views/products/edit.blade.php) [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 y…
SQLite – Rolling Average/Sum
I have a dataset as shown below, wondering how I can do a rolling average with its current record followed by next two records. Example: lets consider the first record whose total is 3 followed by 4 and 7 ,Now the rolling 3 day average for first record would be 4.6 and so on. Expected output: PS: Having ̶…
Join repeats rows too many times
List the employees (first and last name in same column), that work in retail or food and drink. Include the building they work in and shop type. This is what I have. Whenever I run it everything repeats so there’s over a hundred rows now. Can anybody help me? EDIT I’ve tried various joins for this…
can I use different hints in one clause of union in oracle
I have a merge query of below format – now I have to do union in this query My question is do I have to give parallel hint in second union clause also . Also use_hash hint which was running good earlier would not have impact on adding union clause in the query Answer The hints apply to each select
How to mix left and right joins with cross reference table
I’m using Mysql. I have table A(ida) and table B(idb) and a cross reference table CR(ida, idb). I want to capture in a query the relationship between A and B (basically what’s is CR) but I also want all the rows from A and B that have no relations present in CR. To get something like this: I tried…
How do I fix ORA-01843: not a valid month?
So at the query level, I have it: And I’ve tried looking at a few articles with one most notable: How to change the date format in Oracle BI Publisher? I have also tried using: While going through structure and XML I noticed my date is in string format: element name=”DATETIME” value=”D…
PostgreSQL Percent Change using Row Number
I’m trying to find the percent change using row number with PostgreSQL but I’m running into an error where my “percent_change” column shows 0. Here is what I have as my code. Here is my SQL table in case it’s needed. Thank you in advance, I greatly appreciate it. Answer You can u…
Using COALESCE correctly in WHERE clause
Can someone explain why coalesce doesn’t work in the where clause given the following conditions below? How do we use coalesce correctly in this case without changing the below coalesce conditions and only for spoiled = Y? Table Fruit: Query: Using the query above will not return anything. Desired outpu…