Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-06-2012, 02:09 PM   PM User | #1
irinel1996
New to the CF scene

 
Join Date: Sep 2012
Location: Canary Islands, Spain
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
irinel1996 is an unknown quantity at this point
Question Doubt with SQL syntax, but same result

Hello,
I'm new in the forums.

Well, I'm learning SQL and I got a doubt when I do these two requests:
Code:
SELECT firstname,lastname FROM members WHERE money < 1350
Code:
SELECT firstname,lastname FROM members WHERE 1350 > money
Both works OK, but I'd like to know the difference between them.

Thank you!
irinel1996 is offline   Reply With Quote
Old 09-07-2012, 10:41 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
There is no difference. In both cases you are checking to see if 1350 is greater than money. It doesn't matter what order they are so long as you are using the correct comparison operators. The following however would be different
Code:
SELECT firstname,lastname FROM members WHERE money > 1350
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Tags
sql

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 +1. The time now is 11:00 AM.


Advertisement
Log in to turn off these ads.