Linked Questions

2 votes
2 answers
63k views

I need to know whether 'pivot' in SQL Server can be used for converting rows to columns if there is no aggregate function to be used. I saw lot of examples with aggregate function only. My columns are ...
Sivajith's user avatar
  • 193
1 vote
3 answers
24k views

I have a view into which I am pulling properties of vehicles, such as tire size, engine capacity, color, number of doors, etc. This data is stored in multiple tables but I have simplified the data ...
Frank Bailey's user avatar
1 vote
1 answer
15k views

I am trying to SELECT values from a column in my database in order to perform a PIVOT on those values without hard-coding them. SELECT * FROM (SELECT ItemType, [Status] FROM [EVAULTTEST].[dbo]....
Yelwes's user avatar
  • 13
0 votes
2 answers
2k views

I am using SQL-Server 2012, I have a table of credit card transactions as follows: CardScheme RespCode ========================= Visa Declined MasterCard Approved MasterCard Approved ...
Khaled's user avatar
  • 1
0 votes
1 answer
3k views

How do you pivot a table on the value in the field? I have to admit that while I can write some pretty nifty queries, have my CTEs down, and enjoy a wide knowledge of T-SQL programming, Pivots get ...
Dave Clary's user avatar
-1 votes
2 answers
362 views

I have a following data: Comp_id | Cntm_nb | Seq_nb | Amount | Type 1 | 1 | 1 | 2000 | rent 1 | 1 | 1 | 200 | charge 1 | ...
sayed's user avatar
  • 1
1 vote
1 answer
2k views

Data: QID Type DOB ------------- 1 1 01/01/1980 1 2 03/01/1981 1 2 01/02/1991 1 1 01/01/1980 1 2 03/01/1981 ...
user39186's user avatar
2 votes
2 answers
886 views

Table dbsize loading with data of every database size every night. dbsize (id, database_name, database_size, insert_date) It looks like this: - 1 dbname1 1000 1/1/1900 - 2 dbname2 2000 ...
Darko Milic's user avatar
0 votes
1 answer
922 views

I have a table in SQL Server 2008, with mails received from a pop account. The table has the following columns: +------+----+---------+------+------+ | from | to | subject | body | date | +------+---...
Engano's user avatar
  • 1
0 votes
1 answer
883 views

I have looked and cannot find how to show the last # months in a pivot table. Everything I seem to run across codes months statically. I'm seeking a solution that shows something similar to the ...
Matthew Kalla's user avatar
0 votes
1 answer
655 views

so this: so I need: any suggestions?
Jose Martin's user avatar
0 votes
1 answer
436 views

I have this temp table named #DynamicDB, with below data. Date Actual_Prod Forecast_Prod MRB_Parts 01-04-18 1 2 2 02-04-18 3 2 NULL ...
Pankaj Gupta's user avatar
0 votes
1 answer
149 views

I havent worked with Pivot. Not sure if pivot is the right thing to use. Is it possible to show this data: ------------------- | Name | Code | ------------------- |Test A | 1 | |Test B | ...
obautista's user avatar
  • 437
0 votes
0 answers
201 views

I want to generate monthly report and the total in a year based on position(jawatan) that has been applied. Table 1 : tpermohonan (mohon_id pemohon_id mohon_tarikh mohon_online) mohon_id pemohon_id ...
NAS BS's user avatar
  • 1
-3 votes
1 answer
73 views

I have this table: ID Value ----------------- 3 A1 4 A2 8 A20 10 A10 I have to create only ...
Loobe's user avatar
  • 3

15 30 50 per page