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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-09-2006, 04:56 AM   #1
Zester
Confirmed User
 
Zester's Avatar
 
Industry Role:
Join Date: Jul 2003
Posts: 5,344
SQL masters:

What is wrong with this Sub Query:
Code:
SELECT date 
FROM  `records` 
WHERE  STATUS  =  'published' 
AND date = ( select max(date) FROM `records` )
LIMIT = 25;
it's suppose to spit out the date of the latest 25 articles in 'published' status and nothing more.
__________________
* Mainstream ? $65 per sale
* new male contraception

Last edited by Zester; 02-09-2006 at 04:58 AM..
Zester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2006, 06:04 AM   #2
everestcash
Confirmed User
 
Join Date: Apr 2002
Posts: 2,194
i was thinking, is there a way to rewrite that query using 'order by id' or 'date' instead, without using a sub query. That'll be a simpler approach.

like

select from `records` where status = 'published' order by id desc limit 0, 25;
everestcash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2006, 06:09 AM   #3
ddfGandalf
Confirmed User
 
Join Date: Feb 2005
Location: Budapest, Hungary
Posts: 534
select date from records where status='published' order by date desc LIMIT 25;
__________________
ddfGandalf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2006, 06:13 AM   #4
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by everestcash
select from `records` where status = 'published' order by id desc limit 0, 25;
__________________
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
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2006, 06:15 AM   #5
Pryda
Confirmed User
 
Industry Role:
Join Date: Dec 2005
Posts: 905
Quote:
Originally Posted by Zester
What is wrong with this Sub Query:
Code:
SELECT date 
FROM  `records` 
WHERE  STATUS  =  'published' 
AND date = ( select max(date) FROM `records` )
LIMIT = 25;
it's suppose to spit out the date of the latest 25 articles in 'published' status and nothing more.

Your query wants up to 25 record dates for articles published on the same date as the most recent record (published or not).
__________________
Babepedia
Pryda is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2006, 06:20 AM   #6
sickbeatz
The Hustler
 
Join Date: Feb 2005
Posts: 4,993
SELECT date
FROM `records`
WHERE STATUS = 'published' ORDER BY date DESC LIMIT 25;
__________________

GalleryFeeder.com
sickbeatz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.