19-04-2009, 20:50 | #2 |
Moonshine
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
|
Just in case it makes anyone feel more inclined/able to help all i'm trying to do is...
Have 1 table (I think) with about 10 fields in it and a few dozen records. I want to then be able to query it so I can pull up all the records for a certain field with a certain value. i.e say the field was Forename, I want to be able pick out all the records where that is 'Dave' so I can compare the rest and be able to make statements about the data like 'Of everyone called Dave, 5 of them have brown hair' Atm I just have the total numbers in excel so all I can do is say 'there are 7 people called dave' and 'there are 12 people with brown hair' but not link the two. Anyone help? It should be embarrassingly simple but I can't figure it out for the life of me, i've not touched a database for about 5 years.
__________________
|
20-04-2009, 01:21 | #3 |
Screaming Orgasm
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
|
SELECT * FROM <table> WHERE Forename = 'Dave';
SELECT HairColour,COUNT(HairColour) FROM <table> WHERE Forename = 'Dave' GROUP BY HairColour; |
20-04-2009, 01:46 | #4 |
Moonshine
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
|
Cheers, I shall give that a go in a bit!
__________________
|
Thread Tools | |
Display Modes | |
|
|