![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
|
Mysql question
I'm stuck on this problem
![]() For each type of book, list the book type and the average price. Only include paperback books. mysql> SELECT TYPE, AVG(PRICE) -> FROM BOOK -> WHERE PAPERBACK = 'Y'; +------+------------+ | TYPE | AVG(PRICE) | +------+------------+ | SFI | 10.664348 | +------+------------+ 1 row in set (0.00 sec)
__________________
icq 156131086 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
Select type, avg(price) from book where paperback = 'y' group by type
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Registered User
Join Date: Aug 2006
Posts: 63
|
Include a GROUP BY 'column of book name/id' modifier, and it will spit out each book & the average.
http://dev.mysql.com/doc/refman/5.1/...modifiers.html |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
need to "GROUP BY" something
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,109
|
Quote:
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,109
|
lol, you're just a touch quicker than I am ;p
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
58008 53773
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Too lazy to set a custom title
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
|
ha ha ha.. was going to post the same answer as everyone else when there were no replies and then there were 6
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
So Fucking Banned
Industry Role:
Join Date: Jul 2010
Location: Camp Crystal Lake.
Posts: 843
|
Select type, avg(price) from book where paperback = 'y' group by type
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
So Fucking Banned
Industry Role:
Join Date: Jul 2010
Location: Camp Crystal Lake.
Posts: 843
|
Oh... Oh shit... Am I too late?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
|
Dam that was a lot of replies fast...thanks
![]()
__________________
icq 156131086 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Jan 2003
Location: Los Angeles
Posts: 736
|
truncate Books;
__________________
Tanguy 0x7a69 inc. Programmer/President/CEO http://www.0x7a69.com A Leader in Programming since 1996 PHP, Ruby on Rails, MySQL, PCI DSS, and any Technical Consulting |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
not so funny, apparently the guy isn't to familiar with MYSQL
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Mar 2002
Location: how'd I get here?
Posts: 264
|
Ohshit, can I get GFY to do my CS101 homework now? Werd!
__________________
[this signature intentionally left blank] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Registered User
Join Date: Mar 2010
Posts: 2
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Confirmed User
Industry Role:
Join Date: Dec 2001
Location: Portland, OR.
Posts: 6,034
|
Quote:
Your stupid! do not do rm -rf
__________________
ICQ: 52344098 -------------------------------------- 50% Commissions on all Product Sales. http://www.wishing.com/money |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Registered User
Join Date: Mar 2010
Posts: 2
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
So Fucking Banned
Industry Role:
Join Date: Jul 2010
Location: Camp Crystal Lake.
Posts: 843
|
I don't think Bcyber is that stupid.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
|
The group by type is what I needed. Now I know where to come for help with my intro to mysql class
![]() I think I screwed myself on a couple of questions because we're only allowed to use things we've covered so far in the book but I used some other way I found out but oh well. Easy 4.0 in this class.
__________________
icq 156131086 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 |
Confirmed User
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
|
Anyone know how to do this? Can't figure out how to change columns to not null.
Change the Best_Seller column in the Mystery table to reject nulls.
__________________
icq 156131086 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Confirmed User
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
|
nevermind...soon as i posted that i came across it in my book.
__________________
icq 156131086 |
![]() |
![]() ![]() ![]() ![]() ![]() |