I am trying to concatenate three columns from two tables Customer and Invoice, create a new column and find the new_id member whose name begins from ‘Astridgruber’ in SQl Server. The below is causing …
Tag: sql
Query to see the MAX value in Oracle
I have the following N:N table (which stores the people boardings) in my Oracle Database (it is about an airport): CREATE TABLE boardings( Passport VARCHAR2(8), Day DATE, Flight VARCHAR2(8), …
mysql update with if and max
I have lost hours on this and nothing works for me. I have filed strp_aa that is default NULL. The filed strp_aa should update only if its null with MAX strp_aa + 1, and if its not null if it already has a number it should stay the same. short version of code is Also tired I tried multiple things
sql query hangs/times out when passed large data
UPDATED: Guys I am passing list of faculty id’s to stored procedure, when i pass more than 10 faculty id’s it’s taking long time to process the data and sometime times out. I spent good amount of time …
Updating salary on employees for each full year they have been working [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 2 years ago. Improve this question I have to do what i say in the title. I have to update the salary on employees for each full…
SQL query 2 limits
I have the following issue i want to limit on the total amount of items returned while limiting one value to a certain number I do a query like this Now I want to do the following, I have a field called running and I want to be able to say that in these results I want to have maximum
SQL turning rows into columns and populating with values
I’m not quite sure why this table was designed this way, but it’s making it hard to solve my problem. Looking at the data: What I need help with is to do the following: For each name have the type_name as a column and then fill those columns with the default_value or value. Like this: Basically po…
The Delete code doesnt work after it updates a column
When I send data to the procedure which contains the ResStatus as C it updates the ResMaster’s ResStatus as X After it updates the column, I want to delete a record from 2 tables they are- Folio,ResRoomAllocation. I have done the coding but it doesn’t work it only updates the ResStatus as X What&#…
In Django, how can I get a count of records based on a subquery of a subquery?
A baseball player plays in a game if he makes one or more appearances in that game. So, to get a count of the number of games a player played in, you need to count the games that have an inning that have an appearance by that player. Here are my models: The SQL query to achieve what I want
Sort a table but keep groups of rows together
How do I sort a table by it’s minimum value per group but at the same time keep a group of rows together. Below a simple example of what i am trying to accomplish. The table is sorted by the lowest group value, but the group remains together. I am pretty sure this question has been asked already but i