Tags:

ASP.NET MVC: Method-Based LINQ Query of SQL Db as IEnumerable object [closed]


I am trying to query a database for all its record into an IEnumerable object. Here are the relevant codes: Db Context Snippet namespace WebApplicationTemp.Data { public class CSVMetaDbContext : …

Tags:

In SQL how to use if statement using update table command


I am trying to update 2 columns in a table using the update command and I have to use if statement. Table: SQL> create table report(customer_no number primary key, name varchar2(10) not null, …

Tags:

Running subtraction but subtracting only if the amount is still above a limit


I have a table with the following structure, I want to subtract the TotalAmount to Amount but only if the remaining amount would still above the limit. The sorting is the sequence which amount should …

Tags:

Unique records quarter over quarter


I have a table like so – patient_id date org I5434 2020-06-05 Methodist Hospital ertw4 2020-08-03 New York Hospital ouiku35 2020-08-30 Tristar ouiku35 …

Tags:

MySQL- Create Duplicate Results in SELECT statement


I have a table like ColumnA ColumnB ColumnC ABC TextA 3 EFG TextB 1 EFG TextC 2 How do I write a SELECT statement that will return the # of rows for ColumnA and ColumnB based on the values of …

Tags:

How can I change a group_concat column that’s left joined with another table to empty string instead of null when there are no matching records?


I’ve been trying to get a MySQL query that uses a left join combined with a group_concat to get the Amazon S3 paths of all of the profile photos for a given user. What I want is for the photo_keys …

Tags:

Netezza code to convert data ending with minus symbol and instead having it start with minus


In a table I have numbers in the format of character datatype with both minus and plus figures. The issue is the ones having minus which looks like for instance 1.000- (instead of being -1.000) The …

Tags:

Update multiple XML nodes in single Update SQL statement


I want to update multiple XML nodes in single Update query XML: Tony Chase VS <…

Tags:

SQL – Transpose query data with additional rows added in [closed]


I have come once more to seek your guidance. I am not actually sure how possible this is, but I can only hope. I have an already heavily joined and aggregated query which pulls out results as shown in …

Tags:

SQL query to get the aggregate results using row_number over partition by


I have table like the below car_id part_name diagnosis car_1 windscreen good car_1 brakes good car_1 tyres good car_1 wipers good car_2 windscreen good car_2 brakes good car_2 tyres …