Problem I’m trying to find the occurrences of strings in view B in a string in table A. However, the […]
Tag: t-sql
SQL query to count loans issued during each week
Problem Calculate the number of loans issued by the Regional offices for each business week in the period from 38 […]
Query to get distinct items at the top of results and duplicates following
Problem I need to query the table below and list the distinct items at the top of my result set […]
SQL Stored Procedure to export specified data
Problem I’m currently using a stored procedure(sproc) to export to Excel. The sproc is being passed two parameters for @month […]
Second-sealed-bid auction web app
Problem I am working on a second-sealed-bid auction web app. I have an Auction table to keep auction items on […]
SQL to find table containing all specified columns
Problem I have the below code to list all tables which have columns DataAreaId and CountryRegionId. This works, but requires […]
Fetch a department’s total, Its percentage of earnings for that site and its percentage of earnings across the company
Problem I am trying to use the data from one table to produce the result set | Dept | TotalValue […]
Unduplicated counts over various dimensions
Problem I’m working with some data on college students, which has a unique key of SSN, Campus, Credential (type of […]
Excuse me, how many of you are new here? Mind if I JOIN you?
Problem I had perceived an uptick in new reviewers around here, and I wanted to see if the data backed […]
Reduce the code in a WHERE clause without using dynamic SQL
Problem How can I write the following T-SQL query part in a shorter way without using dynamic SQL? WHERE ( […]