|
|
|
||||
|
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 |
|
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
|
|
|
|
|
|
#2 |
|
Viva la vulva!
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 ??? |
|
|
|
|
|
#3 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
? i don't see any difference????
__________________
Make Money
|
|
|
|
|
|
#4 |
|
Viva la vulva!
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.
|
|
|
|
|
|
#5 |
|
Confirmed User
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.
|
|
|
|
|
|
#6 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
Quote:
but the typo is only here on the text... in my code it's site... and still doesn't work... damn mysql....
__________________
Make Money
|
|
|
|
|
|
|
#7 |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
can you tell me a bit more about that after you wake up? i have no clue about what you just said...
__________________
Make Money
|
|
|
|
|
|
#8 | |
|
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
http://dev.mysql.com/tech-resources/...ubqueries.html http://dev.mysql.com/doc/refman/5.0/...ubqueries.html |
|
|
|
|
|
|
#9 | |
|
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
Quote:
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
|
|
|
|
|