query help

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

query help

Post by gurjit »

hi all,

my tables are as follows:

tbl_family(familyid)

tbl_student(stuid,frn_familyid,stu_dob,stu_payment)

what i need to do is seperate all the students so that they are put into categories, depending on what there payment type and sibling status is e.g.

Full Paying (Have no siblings and stu_payment is full)
Joe Bloggs
Sandra King

Half Paying (Have no siblings and stu_payment is half)
Amy Grant
Sophie Knight

0 (has 1 younger student)
Tom Cruise

02 (has 2 younger students)
John Smith

03 (has 3 younger students)
Gary Newton

Y (Youngest students of oldest siblings)
Nick Cruise
Frank Smith
Claire Smith
Louise Newton
Laura Newton
Harry Newton



My question is how can i get a query like this from my tables using ("stu_payment" and "stu_dob") ?????
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Databases.
Post Reply