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 04-03-2007, 02:23 AM   #1
martinsc
Too lazy to set a custom title
 
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
any mysql gurus here?

ok, this is weird... at least for me...
i have three tables
sites - id (autoinc), name, url
dumps - id (autoinc), name, url
posted - id (autoinc), dumpid, linkid, date
i want to show in a query all combinations of sites+dumps that do not exist in posted. (which means links that have not been submitted to dumps).
i am using the following query and it works great in MS sql, but in My sql i always get records back although all combos exist in posted...

Code:
SELECT site, dumpi, sitename, dumpname, dumpurl, siteurl
FROM
(SELECT sites.id AS site, 
     dumps.id AS dumpi, 
     sites.name AS sitename, 
     dumps.name AS dumpname, 
     dumps.url AS dumpurl, 
     sites.url AS siteurl 
FROM sites, dumps) Q
LEFT JOIN posted on
Q.site = posted.siteid
and Q.dumpi = posted.dumpid
WHERE posted.stieid IS NULL

could anybody please take a look at this and tell me, where i am wrong?

thanks a lot!!!
__________________
Make Money
martinsc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 03:12 AM   #2
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
Shouldn't WHERE posted.stieid IS NULL
be WHERE posted.siteid IS NULL
???
mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 03:18 AM   #3
martinsc
Too lazy to set a custom title
 
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
Quote:
Originally Posted by mikeyddddd View Post
Shouldn't WHERE posted.stieid IS NULL
be WHERE posted.siteid IS NULL
???
? i don't see any difference????
__________________
Make Money
martinsc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 03:21 AM   #4
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
Look closely. posted.sTIeid has never been set. posted.sITeid = Q.site.
mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 03:24 AM   #5
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
I'm too tired to work it all through at the moment, but you probably want to use the EXISTS keyword, or use the ANY comparision of subqueries.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 03:25 AM   #6
martinsc
Too lazy to set a custom title
 
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
Quote:
Originally Posted by mikeyddddd View Post
Look closely. posted.sTIeid has never been set. posted.sITeid = Q.site.
damn, you are right...
but the typo is only here on the text... in my code it's site... and still doesn't work...
damn mysql....
__________________
Make Money
martinsc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 03:27 AM   #7
martinsc
Too lazy to set a custom title
 
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
Quote:
Originally Posted by quantum-x View Post
I'm too tired to work it all through at the moment, but you probably want to use the EXISTS keyword, or use the ANY comparision of subqueries.
can you tell me a bit more about that after you wake up? i have no clue about what you just said...
__________________
Make Money
martinsc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 04:13 AM   #8
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by martinsc View Post
can you tell me a bit more about that after you wake up? i have no clue about what you just said...
These pages do it much more succintly than I could-
http://dev.mysql.com/tech-resources/...ubqueries.html
http://dev.mysql.com/doc/refman/5.0/...ubqueries.html
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-03-2007, 07:05 AM   #9
martinsc
Too lazy to set a custom title
 
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
Quote:
Originally Posted by quantum-x View Post
THanks.
i will take a look at it.
but why doesn't the query above doesn't work 100%?
it works in MSSQL fine...
__________________
Make Money
martinsc 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.