SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > General > General Topics
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-24-11, 11:24 AM   #1
Onkel Neal
Born to Run Silent
 
Onkel Neal's Avatar
 
Join Date: Jan 1997
Location: Cougar Trap, Texas
Posts: 21,385
Downloads: 541
Uploads: 224


Default

Thanks so much for the help. I am going to have a look at those course, I find SQL very interesting, I just never got on track with a tutorial that I could follow.

Question: in your query, you stated
SELECT *(all infos, or whatever you need)
The info I would want to select would be userID, signature, homepage, right?


FROM User AS U1 INNER JOIN Sigparsed AS S1 (just abbreviations to type less)
Abbreviations for what? Or did you simply give the join names really short names, like U1 ? That makes sense.

AND U1.Totalposts < 2
That means any member with 1 post will not be selected, right? I can change that to < 1 and select all the 0 post users, right?

Listen, I really appreciate the help.
Neal
__________________
SUBSIM - 26 Years on the Web
Onkel Neal is offline   Reply With Quote
Old 05-24-11, 11:54 AM   #2
Penguin
Ocean Warrior
 
Penguin's Avatar
 
Join Date: Mar 2010
Location: Rheinische Republik
Posts: 3,322
Downloads: 92
Uploads: 0


Default

Quote:
Originally Posted by Neal Stevens View Post
Thanks so much for the help. I am going to have a look at those course, I find SQL very interesting, I just never got on track with a tutorial that I could follow.

Question: in your query, you stated
SELECT *(all infos, or whatever you need)
The info I would want to select would be userID, signature, homepage, right?
np!
With the star it would show you all infos available (all columns) from both tables. If you want to use this statement to find the homepages it would just be something like this: SELECT U1.userpage - this would be usefull for a list of the userpages. To select more, just put a comma between, select U1.userpage, S1.signature, U1.shoesize, etc

Quote:
Originally Posted by Neal Stevens View Post
FROM User AS U1 INNER JOIN Sigparsed AS S1 (just abbreviations to type less)
Abbreviations for what? Or did you simply give the join names really short names, like U1 ? That makes sense.
yes, it just gives short names for the tables in this search query, helps to avoid typing long names for the lazy ones This is helpfull if you want to join several tables. If you want to use the real table names, just delete the "AS..."

Quote:
Originally Posted by Neal Stevens View Post
AND U1.Totalposts < 2
That means any member with 1 post will not be selected, right? I can change that to < 1 and select all the 0 post users, right?
In the example, it would select all users with no or one posts. I thought this would make sense, as we saw today, many spammers make one post, however I think those accounts get vaporized eventually .
If you want to select the users with no posts, you use either "= 0", "<1", or "IS NULL". It depends on how the totalposts column looks if a new user is created. If the db puts a 0 (numeric zero) into that column in the moment a new user registers, you can use one of the first two statements. If the column is empty untill the first postcount is written into it, you have to use the IS NULL statement.
Penguin is offline   Reply With Quote
Old 05-24-11, 01:03 PM   #3
razark
Ocean Warrior
 
Join Date: Mar 2007
Location: Houston, TX
Posts: 2,731
Downloads: 393
Uploads: 12
Default

Subsim:
Come for the spam hunts, stay for the SQL tutorials.
__________________
"Never ask a World War II history buff for a 'final solution' to your problem!"
razark is offline   Reply With Quote
Old 05-24-11, 07:21 PM   #4
Onkel Neal
Born to Run Silent
 
Onkel Neal's Avatar
 
Join Date: Jan 1997
Location: Cougar Trap, Texas
Posts: 21,385
Downloads: 541
Uploads: 224


Default

Hahaha Nice!
__________________
SUBSIM - 26 Years on the Web
Onkel Neal is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.