I tried to execute a select query which I select from the different tables but I still getting duplicate record even I use “DISTINCT”. Below I attached the result from my query. Answer DE_Name is different between 2 rows. So it’s correct. To resolve your problem, just do it However, the root…
Tag: sql-server
IN clause in select query with a subquery
I have a query where I join multiple tables. I would like to filter the results based on the status codes and I also want to get the records that were most recently created. Is the below SQL correct? …
Fix Join table functions or not duplicate values?
So I have a query in NaviCat, it has a part that looks like this: As the Base table has the Identifier Number, but does not contain the Names of the person. It is connected properly and works. However, It is tripling some rows in certain cases. I can get a response back that looks similar to this I would
Count of files received in the last 30 days split by each day
I am trying to get a count of the number of files my company has received in the past month split up by each day. The example below shows what I want the output to look like. | Date- | | -Received- |…
How to use aggregate functions in SQL Server
I have a situation where I have a Customer table and I need to locate document numbers from a column which is structured as a string where the first 4 characters represent the type of document (e.g.,’…
How can I query the list of IDs with conditions on couple of fields?
I have the following two tables: Table A ID Code1 Code2 ————– 1 2000 1 2 3000 2 3 1000 3 4 2100 1 5 3500 5 Table B Code1 Code2 ———– 2100 7 2100 1 3000 2 1000 4 I need to …
SQL How would I show a rolling 3 month average for this query
Need some help with maths side of things with this bit of code. You may see I need help on even more! But any help you could give me would be great Basically, my aim is to bring back an; – AccountID,…
SQL CASE statement needs to handle Text
Apologies if this has been asked before – I’ve spent a couple of hours searching but not found anything that’s helped. It’s quite simple really – I’ve been asked to create a query which includes a field that when it was set up (not by me) was created as a VARCHAR instead of…
Update the Unique number for the co-related records between two columns in the group
I need to identify and update co-related records associated rank under Req_Result column as depicted below. Table name is tblSource. +——+—–+—————–+———+ | Item | key | …
How do I get only the person with the top TotalsS for only one team?
I am using SQL Server. I created two views to get a few results and then made them into one select to use on the inner join. I’m sure there’s an easier way to do this. I couldn’t think of anything else at the moment. Please teach me! My results What I’m looking for Thank you for your t…