Forum Moderators: coopster

Message Too Old, No Replies

Is it Mysql?

         

rokec

7:23 pm on Dec 19, 2006 (gmt 0)

10+ Year Member



Does anyone knows is this SQL or MySQL or anything else?

SELECT Ranks.userID,Ranks.rank,UserDetails.* FROM `Ranks`,`UserDetails` WHERE Ranks.rank<>0 and Ranks.userID=UserDetails.ID ORDER BY `rank` ASC LIMIT -30,30

eelixduppy

8:23 pm on Dec 19, 2006 (gmt 0)



Looks like mysql [mysql.com] to me.

rokec

9:41 pm on Dec 19, 2006 (gmt 0)

10+ Year Member



Yes, it looks like... but what ranks.rank?

eelixduppy

9:42 pm on Dec 19, 2006 (gmt 0)



>>>but what ranks.rank?

rank is the column in the table Ranks


You can refer to a table within the default database as tbl_name, or as db_name.tbl_name to specify a database explicitly. You can refer to a column as col_name, tbl_name.col_name, or db_name.tbl_name.col_name. You need not specify a tbl_name or db_name.tbl_name prefix for a column reference unless the reference would be ambiguous.

[dev.mysql.com...]

:)

coopster

10:39 pm on Dec 19, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Right on, eelixduppy, and I notice you got that punctuation corrected in there too. Punctuation is especially important when it comes to operating systems other than Windows.

The column name is prefaced there by the table name and this term is often called qualifying the column name, or identifier.

[dev.mysql.com...]


Additionally, SQL is a standard. The acronym stands for Structured Query Language and it is an interface language for working with relational database management systems. Sometimes the database developers will create extensions to the standard, meaning they might create functions that are a nifty little addition to make life easier. Here, the

LIMIT
keyword is an extension to the standard, incorporated by two databases of which I am aware, MySQL and Postgresql.

Probably more than you cared to know, but hey, you asked ;)

zCat

10:55 pm on Dec 19, 2006 (gmt 0)

10+ Year Member



The backticks (`) used around the table names are also a pretty good sign of MySQL, and do not occur in PostgreSQL.

coopster

11:47 pm on Dec 19, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Good catch, zCat, I didn't even notice the (non-standard) delimited identifiers. That settles it, it is indeed MySQL.