Skip to content

Tag: sql

Concatenate 2 rows into one in SQL

I have a very simple data structure with just 3 tables: requests employees teams Basically, what I need is to concatenate 2 different SQL selects into one (so that the query could return just one row). If there’s an employee associated with a request, then return their name (title) and concatenate it wi…

SQL query based on column condition

I have a sql table in which below are the columns. I’m using sql server. Id, name, device and information on if device is active or not. Need to have a SQL query for below scenario: I want to display firstdevice, seconddevice columns below based on isActive column. If isACTIVE is 1 then, fill the device…

Trying to extract data form SQL using PS script

I have been trying to get a PS script to work in extracting files (pdf, word, etc.) from an SQL Server database. I came across the PowerShell script below. The script runs and populates the destination folder but all files are 0 bytes and during the script execution. It throws the error: “Exporting Obje…

Unnecessary blank row in SQL query

Aim was to write a SQL query to return ride details from a public database. While going through a data analytics course, I stumbled across this problem. the code used is correct as the instruction provided was the same however the result I obtained was different. The first row returned a blank row with just t…