I have an Employees table where I have columns such as last_name first_name,salary, etc.. I want to write a query which will replace S or s to ‘K’ K or k to ‘A’ A or a to ‘E’ E or e to ‘S’ for …
How to handle aggregate function in Case statements when it involves date columns
I’m calculating invoiceDate vs currentDate then sum Value/Amount column grouping by Customer but its returning “invoiceDate is not contained in either an aggregate function or the GROUP BY clause” …
Regular expression blacklist
Can someone explain to me the meaning of the following query: SELECT message.message FROM message CROSS JOIN Blacklist WHERE(message.message LIKE {fn CONCAT({fn CONCAT(‘%’, Blacklist.Words)}, ‘%…
Convert SQL query to Entity Framework which used AggregateFunctions and Where clause
How can I convert this query to Entity Framework? SQL query: SELECT Fullname, SUM(CoinCount+DiamondCount) AS GeneralPoint FROM Students, Groups WHERE Students.GroupId = Groups.Id AND Groups.Name = ‘…
SQL.. Is it possible?
SQLite with python. column1 | column2 | a | 1 | a | 2 | a | 3 | b | 1 | b | 2 | b | 3 | c | …
LIKE in multiple columns
I have columns title, description, keywords and I want to search a text in them. I’m using PostgreSQL. SELECT title FROM products WHERE ANY(ARRAY(title, description, keywords) like ‘%test%’) I’…
How to select last one week data from last date
I want sum of price in my table depended by ‘CorpCode’ from other table where ‘InvoiceDate’ between last week from Max(InvoiceDate)LastInvoiceDate My table design is: T1: CorpCode AuthorNo …
How to count the Gap between dates in SQL Server with overlapping dates
I’m trying to get the GAP (In days) between records in one Table, I’m using SQL Server. So far, I was able to get the gap (in days) between dates, but there was an issue with the overlapping dates. …
How to display number of employees of each position in each department
I have two tables, named Employee and Department. Employee (Emp_ID, Name, Position, DeptID) Department (Department_ID, Dept_Name). The position of an employee may be tech_support, data_entry, or …
Sql Server Float to C# double adding trailing zeros
I have a float column in SQL Server with value 21.261 , when I am fetching this column into c# double , using entity framework core 2.0 it is becoming 21.2610000000042, how to avoid this and get the …