I have two tables, generatedblock table, and addresses table The generatedblock table has a column called expandedblock block. The addresses table has a column called address. What I need to do is find if in the generatedblock table there is a value in the addresses table. I have tried failed code but I am no…
Tag: sql-server
Calculating minutes between two timestamps in a pivot table
I have a SQL query that makes a pivot table showing the timestamps of various temperature points being collected. I need to add columns to show the difference between point 1 (126) and point 2 (120) …
SQl Query to get an output that resembles the image [closed]
I would like to get output the way its shown in the image attached and the way the input is organized is also shown in the image attached. Thanks!
Select within grouped query to return last record of that group
I have a table which stores events along with event type and booking ID’s, my goal is to group the BookingID and return the first EventDate, the last EventDate and the last BC_EventType | ID | …
how i can get all products from parentid in SQL Server?
I have a category table to name TBL_category And includes the following fields: nid i identity field and i have a production Table TBL_Productions and foreign key is to nid And includes the following fields: productid is identity My question is: How can I display all products, when user selected mobile catego…
Group Date ranges with separate groups if other date in between
I have a Table like this: I want to select an Start Date and an End date and group them by Specification. So my Output should look like this: I tried it with: but this doesnt give my desired result. Does anyone have an Idea? Answer You can try the below – it’s a gap & island problem
SQL Pivot multiple column [closed]
I have table like this:- and want output like this:- Any help?
Numbering sequences from xml according element’s values
The PointNum attribute means the number of coordinates in the chain. The coordinate chain starts at 1 and ends at 1 as well (inside each Parcel element). However, within the sequences of these points, …
Showing conditional Where Condition in SQL SERVER
I am trying to achieve something like this. SELECT Name, Age From Employee WHERE ID=1 AND CASE(WHEN backguid=’00000000-0000-0000-0000-000000000000′ THEN (State=@state and City = @city) ELSE (…
Is it possible to lock on a value of a column in SQL Server?
I have a table that looks like that: Id GroupId 1 G1 2 G1 3 G2 4 G2 5 G2 It should at any time be possible to read all of the rows (committed only). When there will be an …