Click here to Skip to main content
15,888,521 members
Home / Discussions / Database
   

Database

 
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 
GeneralRe: View Pin
David Skelly13-May-11 2:22
David Skelly13-May-11 2:22 
GeneralRe: View Pin
Shameel17-May-11 4:45
professionalShameel17-May-11 4:45 
AnswerRe: View Pin
SilimSayo12-May-11 5:46
SilimSayo12-May-11 5:46 
AnswerRe: View Pin
Shameel17-May-11 4:48
professionalShameel17-May-11 4:48 
Questiondatabase function Pin
manoj bhatt 11-May-11 6:14
manoj bhatt 11-May-11 6:14 
AnswerRe: database function Pin
SilimSayo11-May-11 8:08
SilimSayo11-May-11 8:08 
GeneralRe: database function Pin
Peter_in_278011-May-11 15:33
professionalPeter_in_278011-May-11 15:33 
GeneralRe: database function Pin
SilimSayo12-May-11 0:09
SilimSayo12-May-11 0:09 
QuestionWhere is my table created... Pin
Jun Du11-May-11 5:00
Jun Du11-May-11 5:00 
AnswerRe: Where is my table created... Pin
Blue_Boy11-May-11 5:17
Blue_Boy11-May-11 5:17 
GeneralRe: Where is my table created... Pin
Jun Du11-May-11 5:44
Jun Du11-May-11 5:44 
GeneralRe: Where is my table created... Pin
Corporal Agarn11-May-11 8:27
professionalCorporal Agarn11-May-11 8:27 
GeneralRe: Where is my table created... Pin
Jun Du11-May-11 6:37
Jun Du11-May-11 6:37 
GeneralRe: Where is my table created... Pin
Blue_Boy11-May-11 20:47
Blue_Boy11-May-11 20:47 

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.