|
Dear Sir/Madam Could you help to give me an example how to quiry pivot 4 tables as below:
I'm waiting for your help. many thanks Kosal
(comments are locked)
|
End of Procedure TABLES AND SAMPLE DATA Which I hav used ---Output will be For : Kosal Please format properly while u r framing a question , it was quite difficult to read and understand. I hav done the changes by assuming that this is wat u need.. Dear Sir many thanks for your help, if I want to display it on asp.net table how can I do can you show me. thank
Jul 08 '10 at 12:42 AM
kosaly
Please mark it as answer if it is resolved so others can find the answer too .. u can use it in asp.net bcoz it returns a recordset
Jul 08 '10 at 01:00 AM
Alban Lijo
Try commenting out the CREATE UNIQUE INDEX in the Stored Procedure and try .. it should work..
Jul 08 '10 at 04:14 AM
Alban Lijo
(comments are locked)
|
|
How's this? This first chunk is just setting up some temporary tables to show the concept: Here's the actual query: And the results: There may be a more elegant solution somewhere. I'm still learning my way around the PIVOT statement...
Jul 07 '10 at 03:52 AM
ThomasRushton ♦
(comments are locked)
|
--- NOW CREATE PROCEDURE exec uspTmpPivotTableTry ' will fetch u all records even if more Tourclasses added Results --------------- It doesn't use Pivot method but effective, bcoz we r not fixing the columns You can Add Few more Tour Class and TourHotel to check.. it works Fine Dear Sir many thanks for your help, one more I want you to help as below.
and I want to display as below: City Name Deluxe Class Superior Standard Siem Reap CityAngkor Hotel Angkor Star Hotel Khemera Angkor Hotel Phnom Penh Phnom Penh Hotel New York Hotel Pacific Hotel Sihanouk Sihanouk Hotel Sokha beach Hotel Costle Hotel Sorry for ask you again. I'm Waiting for your help. thanks with my best regards Kosal
Jul 07 '10 at 06:56 PM
kosaly
You should add this as a new question to be able to accept an answer to both of your questions. First of all, If you don't it is hard for others that have similar problems and need help to find out what was the solution to your question. Second, the people that help you will probably want to get credit for their help, but the most important is ofcourse the first of my arguments.
Jul 08 '10 at 12:44 AM
Håkan Winther
(comments are locked)
|

