I want to insert data on to two different tables in SQL server from VB.net. I have Identity increment set up in SQL that is where the order# comes from. The rest of the data comes from vb.net. Another issue is that every time I capture an order, everything from the Order table copies to the Order Details tabl…
Tag: sql
SAS – Group By not working due to case statement in Select
I have an issue where some SAS code using PROC SQL isn’t working as there is a case statement around one of my calculations. The code looks like the below: This code returns duplicated rows for the number of rows in table A. Removing the case statement as below: This just returns the group by using the …
SQL complicated SELECT query
I would like to have a select query, where I get all the games that a specific user played with the points of his and the opponents team. Entity relatioship model of my database This is my current query: The current query gives me this result: userId gameId won points 1 1 true 19 Problem: From this query I on…
refactoring sql while loop to regular inserts
I am inserting parent records and child records at the same time in a stored procedure. Rather than have outside code make nested calls to create each parent and then each child of that parent (which is even slower than my current approach), I am giving the sql a comma separated list of child types that I put…
Updating webclient response from database
I have situation where I can’t update column at database. The problem is that only method setIsPurchased is executed and the flag is_purchase at SQL table changed to true, but the next line with setPurchasedDate which has to set current time is not executed. The response from database is Mono<Void>…
MYSQL JOINS, Got Stuck [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 months ago. Improve this question good day! i’m in the middle of learning new thing in mysql, i need join 2 tables, tab…
Respecting GROUP BY Clause in a MySQL SUB-QUERY
I have a query which returns some figures from a table of sales data. The table contains data for a number of different sales managers. I need to return data for the individual managers and also some calculated figures. One of the figures I’m trying to get at involves a subquery. Getting the figures for…
MYSQL Update same column with multiple where clause
I found this question, seems like same as mine. However, there’s a little difference between the two as that one is using the same column in where clause and I have a different one. This is what I’m trying to achieve; is it possible to do that in one query? EDIT: The data type of recent is Boolean…
Is there any way we can emulate the way of using :old and :new of row triggers in statement triggers in PL/SQL
Good Day Buddies! So, here is my Question, it says – Write a update, delete trigger on clientmstr table. The System should keep track of the records that ARE BEING updated or deleted. The old value of updated or deleted records should be added in audit_trade table. (Separate implementation using both ro…
How to make a unique constraint on date that there is no row with date within x months
I have a table that has a timestamp column something like: table Elements I would like to put a unique constraint on the table that will make sure that there are NO two entries with the same name and type and are within X months of any other row. I have asynchronous processes that push rows into this table, a…