Click here to Skip to main content
14,970,143 members
Home / Discussions / Database
   

Database

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 3:10
cofounderChris Maunder16-Jul-09 3:10 
PinnedHow to get an answer to your question PinPopular
Chris Maunder10-Nov-05 16:30
cofounderChris Maunder10-Nov-05 16:30 
QuestionLooking for advice on key/value storage options Pin
Chris Maunder16-Jul-21 6:21
cofounderChris Maunder16-Jul-21 6:21 
AnswerRe: Looking for advice on key/value storage options Pin
Mycroft Holmes16-Jul-21 12:23
professionalMycroft Holmes16-Jul-21 12:23 
GeneralRe: Looking for advice on key/value storage options Pin
Chris Maunder16-Jul-21 16:11
cofounderChris Maunder16-Jul-21 16:11 
AnswerRe: Looking for advice on key/value storage options Pin
k505416-Jul-21 14:21
mvek505416-Jul-21 14:21 
GeneralRe: Looking for advice on key/value storage options Pin
Chris Maunder16-Jul-21 16:19
cofounderChris Maunder16-Jul-21 16:19 
QuestionOpen Office Database Pin
Bram van Kampen1-Jul-21 14:26
MemberBram van Kampen1-Jul-21 14:26 
AnswerRe: Open Office Database Pin
Richard MacCutchan1-Jul-21 21:04
mveRichard MacCutchan1-Jul-21 21:04 
GeneralRe: Open Office Database Pin
Bram van Kampen2-Jul-21 14:54
MemberBram van Kampen2-Jul-21 14:54 
QuestionSelect with pivot Pin
Ismael Oliveira 202119-Jun-21 18:25
MemberIsmael Oliveira 202119-Jun-21 18:25 
Hi, everyone.
I'm trying to recover data from SQL Server using the pivot operator. My command is:
select isnull([1], 0) as Janeiro,
       isnull([2], 0) as Fevereiro,
	   isnull([3], 0) as Março,
	   isnull([4], 0) as Abril,
	   isnull([5], 0) as Maio,
	   isnull([6], 0) as Junho,
	   isnull([7], 0) as Julho,
	   isnull([8], 0) as Agosto,
	   isnull([9], 0) as Setembro,
	   isnull([10], 0) as Outubro,
	   isnull([11], 0) as Novembro,
	   isnull([12], 0) as Dezembro
from (select month(PP.PAPA_DT_DATAPAGAMENTO) as Mesn, PP.PAPA_RE_VALORPAGAMENTO from PAGAMENTO_PARCELA PP, PAGAMENTO P
     where PP.MOVI_NA_CODIGO = P.MOVI_NA_CODIGO AND P.SUPA_NA_CODIGO = 5) Tab1
pivot (sum(PAPA_RE_VALORPAGAMENTO) for Mesn in ([1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12])) P1

The way it is above it works fine. Now I need to multiply the sum by a factor, say 0.95. I tried the following:
pivot (0.95 * sum(PAPA_RE_VALORPAGAMENTO) ...
pivot (sum(0.95 * PAPA_RE_VALORPAGAMENTO) ...
0.95 * pivot (sum(PAPA_RE_VALORPAGAMENTO) ...
None of these worked. Can anyone help me? Which is the right way?
Thanks.
AnswerRe: Select with pivot Pin
CHill6023-Jun-21 4:50
mveCHill6023-Jun-21 4:50 
GeneralRe: Select with pivot !! Pin
Member 1410904313-Jul-21 21:34
MemberMember 1410904313-Jul-21 21:34 
GeneralRe: Select with pivot !! Pin
CHill6014-Jul-21 3:50
mveCHill6014-Jul-21 3:50 
GeneralRe: Select with pivot !! Pin
Member 1410904314-Jul-21 3:58
MemberMember 1410904314-Jul-21 3:58 
GeneralRe: Select with pivot !! Pin
CHill6014-Jul-21 4:09
mveCHill6014-Jul-21 4:09 
QuestionAbout MySQL table permission removal failed Pin
Member 1105472311-Jun-21 8:00
MemberMember 1105472311-Jun-21 8:00 
AnswerRe: About MySQL table permission removal failed Pin
Richard Deeming13-Jun-21 22:09
mveRichard Deeming13-Jun-21 22:09 
QuestionSandwich Query For Employee Attendance using SQL Server 2005 Pin
Mohammad Salmani8-Jun-21 20:40
MemberMohammad Salmani8-Jun-21 20:40 
AnswerRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Richard MacCutchan8-Jun-21 21:55
mveRichard MacCutchan8-Jun-21 21:55 
AnswerRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
DevParty9-Jun-21 1:35
MemberDevParty9-Jun-21 1:35 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Mohammad Salmani9-Jun-21 3:08
MemberMohammad Salmani9-Jun-21 3:08 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
DevParty9-Jun-21 3:39
MemberDevParty9-Jun-21 3:39 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
David Mujica9-Jun-21 4:25
MemberDavid Mujica9-Jun-21 4:25 
GeneralRe: Sandwich Query For Employee Attendance using SQL Server 2005 Pin
Mycroft Holmes9-Jun-21 12:36
professionalMycroft Holmes9-Jun-21 12:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.