|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
m havin' hard time grouping with this type of table.
itemrequestdetails ------------------ (PK)requestID, andsomeotherfields.. prefbrand --------- (FK)productCode, (FK)brandID, (FK)requestID itemrequestdetails is the transaction table for all the request made. prefbrand is the referrence table for all the preferred brands per productCode in every request. the situation: each request may have at least 1 productCode and at least 1 brandID the problem: i want to group all request that have exactly the same productCode and number of brandID(s). even if one brandID is different for each request, i dont want to group them together. by the way i will be creating this as a views to illustrate: itemrequestdetails ------------------ requestID, andsomeotherfields.. 1 someothervalues.. 2 someothervalues.. 3 someothervalues.. prefbrand --------- productCode, brandID, requestID item1 A 1 item1 B 1 item1 C 1 item1 A 2 item1 B 2 item1 C 2 item1 B 3 item1 C 3 item1 D 3 (take note on the brandID's on request 3) as you can see grouping this with a regular group by would have a result like this.. productCode, brandID, requestCount item1 A 2 item1 B 3 item1 C 3 item1 D 1 ..which is not the result that i want.. the result that i wanted should be like this one below.. productCode, brandID, requestCount item1 A 2 item1 B 2 item1 C 2 item1 B 1 item1 C 1 item1 D 1 ..is this possible? |
|
#2
|
|||
|
|||
|
heeellllppp!!
can anybody help me with this?? pleazzzzz..!!
|
|
#3
|
|||
|
|||
|
already got an answer..
![]() you can check it ou here.. http://www.experts-exchange.com/Dat...Q_20608107.html |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > problem with group by |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|