Click here to Skip to main content
15,892,298 members
Home / Discussions / Database
   

Database

 
GeneralRe: Simple Dataset Question... Pin
Verdant12319-Feb-04 19:06
Verdant12319-Feb-04 19:06 
GeneralRe: Simple Dataset Question... Pin
Bill Dean20-Feb-04 5:07
Bill Dean20-Feb-04 5:07 
GeneralRe: Simple Dataset Question... Pin
Verdant12322-Feb-04 3:01
Verdant12322-Feb-04 3:01 
GeneralParameters of PutElement() Pin
girl_lash18-Feb-04 16:26
girl_lash18-Feb-04 16:26 
Generalassociating child to parent Pin
ylaine18-Feb-04 16:05
ylaine18-Feb-04 16:05 
GeneralMissing VNSAPI32.dll Pin
Bakos, Zsolt18-Feb-04 9:50
Bakos, Zsolt18-Feb-04 9:50 
GeneralRe: Missing VNSAPI32.dll Pin
Mike Dimmick19-Feb-04 6:12
Mike Dimmick19-Feb-04 6:12 
GeneralTrouble with query Pin
gamerPotatoe18-Feb-04 1:38
gamerPotatoe18-Feb-04 1:38 
Hi there I habve a problem with a query on two relations
I have two relations here:

RESERVED_LEGS
PNR|FLNO|FLDATE|RSRVDATE

And
Tickets_Purchased
TKTNO|CLASS|DATEPURCHASE|PRICE|LEGID|PNR|WLR

this is a simple flight reservation scenario.

-When a passenger buys a ticket an entry is made in the tickets

purchased relation
- and if he makes a booking on that relation the ticket number is

associated with an autogenerated PNR value (other wise null if no reservation is made on ticket) and updated in the

tickets_PURCHASED relation
- AND LIKEWISE an entry with the correposnding PNR is made in the

RESERVED_LEGS TABLE where details of the flight number and date are

added.

There are 2 classes of tickets here namely
-first
-Third

The problem is that I have to make a query which shows the number of

resercvations made (in this case entries in the Reserved_Legs table) on

the basis of class of tickets upon which reservations were made as well

as broke up into months i.e.

------------------------------------------------
|Class |Jan|Feb|March|April|May|June|July|Aug.....
------------------------------------------------
------------------------------------------------
|First |130|500|320 |112 |120|100 |145 |145|
------------------------------------------------
|Third |402|180|110 |510 |410|110 |128 |162|
------------------------------------------------

The thing is that I'm not sure how this can be accomplished by an SQL

query, I've been hacking at it for a while and still have no luck. I

tried some queries but the thing is that at anytime there is no

guarantee that there will be a ticket of all teh classes booked in all

the months.

What would be the best way to do this. Any SQL that can create the

above relation or is any PL required. I'm doing this for a project and

I'm using SQL server 2000 Smile | :) and would like any suggestions.




GeneralRe: Trouble with query Pin
Mike Dimmick18-Feb-04 2:36
Mike Dimmick18-Feb-04 2:36 
GeneralRe: Trouble with query Pin
Edbert P19-Feb-04 13:28
Edbert P19-Feb-04 13:28 
GeneralHelp with big stored procedure Pin
Verdant12317-Feb-04 20:25
Verdant12317-Feb-04 20:25 
GeneralRe: Help with big stored procedure Pin
Not Active18-Feb-04 1:06
mentorNot Active18-Feb-04 1:06 
GeneralRe: Help with big stored procedure Pin
Verdant12318-Feb-04 1:58
Verdant12318-Feb-04 1:58 
Generalgetting columns data rowwise Pin
percyvimal17-Feb-04 16:59
percyvimal17-Feb-04 16:59 
GeneralRe: getting columns data rowwise Pin
Mazdak17-Feb-04 18:23
Mazdak17-Feb-04 18:23 
GeneralCreating SQL tables from XML schema Pin
blurp17-Feb-04 13:04
blurp17-Feb-04 13:04 
GeneralShowing Multiple tables in Datagrid Pin
Qamarwis17-Feb-04 9:56
Qamarwis17-Feb-04 9:56 
GeneralRe: uMultiple tables in Datagrid Pin
Mazdak17-Feb-04 10:01
Mazdak17-Feb-04 10:01 
QuestionWhat is ??? The Problem Pin
jinbabaj17-Feb-04 3:56
jinbabaj17-Feb-04 3:56 
AnswerRe: What is ??? The Problem Pin
Edbert P17-Feb-04 17:19
Edbert P17-Feb-04 17:19 
GeneralRetrieving a list of tables (ADO) Pin
pl0p16-Feb-04 17:28
pl0p16-Feb-04 17:28 
GeneralRe: Retrieving a list of tables (ADO) Pin
Mazdak16-Feb-04 17:47
Mazdak16-Feb-04 17:47 
GeneralRe: Retrieving a list of tables (ADO) Pin
-Dr_X-20-Feb-04 11:16
-Dr_X-20-Feb-04 11:16 
GeneralAccess Pin
Anonymous16-Feb-04 16:05
Anonymous16-Feb-04 16:05 
GeneralRe: Access Pin
-Dr_X-20-Feb-04 11:23
-Dr_X-20-Feb-04 11:23 

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.