WhyMe HFR ? Nan, connais pas ... | Qq exemples :
( attention, mes requêtes sont construites ds l'appli en C#, donc {0} et {1} sont des paramètres propres à chaque client )
Code :
- // Chargement des tickets 'local'
- SELECT
- ID_PhoneLine,
- ( CONVERT ( VARCHAR ( 50 ), BeginDate, 103 ) + ' ' + CONVERT ( VARCHAR ( 50 ), BeginDate, 108 ) ) AS Da,
- CONVERT ( decimal ( 18, 3 ), Price ) AS P,
- NumberCalled AS NC,
- FormattedDuration AS Du
- FROM TicketList
- INNER JOIN PhoneLine ON PhoneLine.ID_PhoneLineVoiceInfo = TicketList.ID_PhoneLineVoiceInfo
- WHERE ID_Invoice = {0}
- AND TicketList.ID_PhoneLineVoiceInfo = {1}
- AND ID_NationalCallType = 1
- ORDER BY BeginDate
- // Cumul des tickets 'local'
- SELECT
- MIN ( PhoneLine.ID_PhoneLine ) AS ID_PhoneLine,
- SUM ( TicketList.Price ) AS SumPrice
- FROM TicketList
- INNER JOIN PhoneLine ON PhoneLine.ID_PhoneLineVoiceInfo = TicketList.ID_PhoneLineVoiceInfo
- WHERE ID_Invoice = {0}
- AND TicketList.ID_PhoneLineVoiceInfo = {1}
- AND ID_NationalCallType = 1
- // Chargement des tickets 'national'
- SELECT
- ID_PhoneLine,
- ( CONVERT ( VARCHAR ( 50 ), BeginDate, 103 ) + ' ' + CONVERT ( VARCHAR ( 50 ), BeginDate, 108 ) ) AS Da,
- CONVERT ( decimal ( 18, 3 ), Price ) AS P,
- NumberCalled AS NC,
- FormattedDuration AS Du
- FROM TicketList INNER JOIN PhoneLine ON PhoneLine.ID_PhoneLineVoiceInfo = TicketList.ID_PhoneLineVoiceInfo
- WHERE ID_Invoice = {0}
- AND TicketList.ID_PhoneLineVoiceInfo = {1}
- AND ID_NationalCallType = 2
- ORDER BY BeginDate
- // Cumul des tickets 'national'
- SELECT
- MIN ( ID_PhoneLine) AS ID_PhoneLine,
- SUM ( Price ) AS SumPrice
- FROM TicketList
- INNER JOIN PhoneLine ON PhoneLine.ID_PhoneLineVoiceInfo = TicketList.ID_PhoneLineVoiceInfo
- WHERE ID_Invoice = {0}
- AND TicketList.ID_PhoneLineVoiceInfo = {1}
- AND ID_NationalCallType = 2
|
|