Click here to Skip to main content
15,913,685 members
Home / Discussions / Database
   

Database

 
Questionmembers db or table? Pin
Jassim Rahma15-May-11 2:13
Jassim Rahma15-May-11 2:13 
AnswerRe: members db or table? Pin
dasblinkenlight15-May-11 22:54
dasblinkenlight15-May-11 22:54 
GeneralRe: members db or table? Pin
Jassim Rahma16-May-11 3:41
Jassim Rahma16-May-11 3:41 
GeneralRe: members db or table? Pin
dasblinkenlight16-May-11 3:50
dasblinkenlight16-May-11 3:50 
GeneralRe: members db or table? Pin
Jassim Rahma16-May-11 4:02
Jassim Rahma16-May-11 4:02 
GeneralRe: members db or table? Pin
dasblinkenlight16-May-11 4:10
dasblinkenlight16-May-11 4:10 
AnswerRe: members db or table? Pin
Shameel17-May-11 4:34
professionalShameel17-May-11 4:34 
QuestionUsing a variable table [modified] Pin
MAW3014-May-11 9:28
MAW3014-May-11 9:28 
AnswerRe: Using a variable table Pin
jschell14-May-11 11:39
jschell14-May-11 11:39 
QuestionDynamic column based on row Pin
Ramkumar_S13-May-11 23:26
Ramkumar_S13-May-11 23:26 
AnswerRe: Dynamic column based on row Pin
dasblinkenlight15-May-11 22:47
dasblinkenlight15-May-11 22:47 
QuestionMySql Foreign key referencing Pin
sajid.salim.khan13-May-11 21:39
sajid.salim.khan13-May-11 21:39 
AnswerRe: MySql Foreign key referencing Pin
Shameel17-May-11 4:38
professionalShameel17-May-11 4:38 
QuestionMySql Foreign key Pin
sajid.salim.khan13-May-11 21:24
sajid.salim.khan13-May-11 21:24 
AnswerRe: MySql Foreign key Pin
jschell14-May-11 11:42
jschell14-May-11 11:42 
QuestionSql Server Fetching Data Pin
Ravi_2112-May-11 22:28
Ravi_2112-May-11 22:28 
AnswerRe: Sql Server Fetching Data Pin
Groulien12-May-11 22:40
Groulien12-May-11 22:40 
AnswerRe: Sql Server Fetching Data Pin
Simon_Whale13-May-11 0:41
Simon_Whale13-May-11 0:41 
AnswerRe: Sql Server Fetching Data Pin
SilimSayo13-May-11 3:22
SilimSayo13-May-11 3:22 
AnswerRe: Sql Server Fetching Data Pin
jschell13-May-11 9:03
jschell13-May-11 9:03 
AnswerRe: Sql Server Fetching Data Pin
Shameel17-May-11 4:41
professionalShameel17-May-11 4:41 
QuestionDuplicate a record Pin
solomon1300012-May-11 4:28
solomon1300012-May-11 4:28 
I managed to duplicate a single record. However I intended to display the duplicate record with different values. For example:

A ABC 065 001 A10111 Sell 54.847500 0 0
T ABC 065 001 A10111 Sell 50.847500 0 1


SELECT 
 
case i.ordStatus 
when 'Queued' then 'N'
when 'Filled' then 'A'
when 'Partial Filled' then 'A'
when 'Cancel' then 'C'
end AS 'ordStatus',
 
f.code AS 'exchCode', 
g.code AS 'companyCode', 
h.code AS 'branchCode',
c.code AS 'clientCode',
i.transType AS 'transType',
 
case i.ordStatus 
when 'Queued' then ((i.quantity * i.price * i.exchRate) / j.denomination)
when 'Filled' then ((i.adjust * i.price * i.exchRate) / j.denomination)
when 'Partial Filled' then ((i.adjust * i.price * i.exchRate) / j.denomination)
when 'Cancel' then ((i.adjust * i.price * i.exchRate) / j.denomination)
end AS 'ordAmount',
 
case i.ordStatus 
when 'Queued' then 0
when 'Filled' then 0
when 'Partial Filled' then 0
when 'Cancel' then 0
end AS 'matchAmount'
 
FROM TM_TradingProfile a 
LEFT JOIN TM_clientTradingProfile b 
ON a.id = b.id  
LEFT JOIN TM_Client c 
ON c.id = b.TM_client_fk 
LEFT JOIN BKL_User d 
ON d.id = c.id 
JOIN BKL_Authentication e 
ON c.id = e.BKL_user_fk 
LEFT JOIN RM_Exchange f
ON a.RM_exchange_fk = f.id
LEFT JOIN BKL_Company g
ON a.BKL_company_fk = g.id
LEFT JOIN BKL_Branch h
ON a.BKL_branch_fk=h.id
LEFT JOIN RM_MarketTransaction i
ON a.tradingAccountNumber = i.tradingAccNo
LEFT JOIN bkl_forexexch j
ON i.tradCurr = j.currencyCodeFrom
 
CROSS JOIN (SELECT 1 UNION ALL SELECT 1) AS T(x)
 
WHERE a.tradingAccountNumber='ST3273'


Besides, I should be able to display a duplicate record when the ordStatus is filled or partial filled.

Your help is kindly appreciated.

Thank You.
AnswerRe: Duplicate a record Pin
SilimSayo12-May-11 8:38
SilimSayo12-May-11 8:38 
QuestionView Pin
Dhyanga12-May-11 3:50
Dhyanga12-May-11 3:50 
AnswerRe: View Pin
Blue_Boy12-May-11 4:26
Blue_Boy12-May-11 4:26 

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.