Skip to content
Advertisement

Tag: tsql

Replace row with Column Data in Sql Server

I have a table with some data and I was trying to Replace the Column with Row. The above Query gives me the result in one single row data. But I want the Result in below format I have tried the Pivot Operator using Derived Column but got confused during implementation. Please help to get the correct query. Answer Assuming

SQL Key Value Pair Query

I have two tables: Product Table ID (PK), Description, CategoryID, SegmentID, TypeID, SubTypeID, etc. Attribute Table ID (PK), ProductID (FK), Key, Value And I would like to query these two …

Converting month name to month number in SQL Server

I have a column (says Period_name ) that accepts varchar value. Inside the column, I have inputs likeJan-19, Feb-19, etc. I need an SQL instruction whenever left of Period_name comes like Jan, Feb then it should convert into corresponding month number. For example Input Output The SQL query condition is as follows: Thanks 🙂 Answer Just another option is to

Advertisement