How to select the First row from a MySQL table

July 6, 2009 Rui Miguel Feio

You can use the following command to get the first row from a MySQL table: SELECT * FROM table LIMIT 1 Explanation: table – table name   By limiting the returns to 1 (LIMIT 1) we get the first row from the table. Example: SELECT * FROM tusers LIMIT 1

How to select the Last row from a MySQL table

July 6, 2009 Rui Miguel Feio

You can use the following command to get the last row from a MySQL table: SELECT * FROM table ORDER BY field DESC LIMIT 1 Explanation: table – table name field – table field This command orders the table by DESCENDING order and limits the number of rows returned to […]

Select random rows from a MySQL table

July 6, 2009 Rui Miguel Feio

If you ever come across the need of randomly select rows from a MySQL table: SELECT * FROM table WHERE field1 = value ORDER BY RAND() LIMIT x Explanation: table – table name field1 – table field value – value you want field1 to be x – number of rows […]

The 12 Principles Of Successful Freelancing

July 5, 2009 Rui Miguel Feio

This was taken from the book “The Principles Of Successful Freelancing” authored by Miles Burke (which I highly recommend) and should be used as guide lines to your sucessful freelancing career: Get Organized – Keep your workspace tidy and plan ahead (short- and long-term). Control Stress – Remain calm and […]

How to check if an LPAR is part of a SYSPLEX?

July 3, 2009 Rui Miguel Feio

If you need to check if an LPAR is part of a SYSPLEX or the SYSPLEX name it belongs to simply issue the command: D XCF Example: D XCF Returns: RESPONSE=TST1 IXC334I  09.32.10  DISPLAY XCF 309 SYSPLEX TESTPLEX:   TST1 TST2 TST3 Notes: the command was issued from LPAR TST1 in […]

1 2 3