Working with MySQL SQL 42 In this query, (Struts web hosting)
Working with MySQL SQL 42 In this query, the system selects all of the rows in the acc table where a value is NULL, and the username value is jime. SELECT Statement Extensions Up to this point, we have been showing simple SELECT commands both with and without conditions. The SELECT command has a whole list of extensions that can be used to further filter and manipulate the data received from the database. MySQL s SELECT includes the following extensions: SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] [HIGH_PRIORITY] [DISTINCT | DISTINCTROW | ALL] select_expression,… [INTO {OUTFILE | DUMPFILE} ‘file_name’ export_options] [FROM table_references [WHERE where_definition] [GROUP BY {unsigned_integer | col_name | formula} [ASC | DESC], … [HAVING where_definition] [ORDER BY {unsigned_integer | col_name | formula} [ASC | DESC] ,…] [LIMIT [offset,] rows] [PROCEDURE procedure_name] [FOR UPDATE | LOCK IN SHARE MODE]] Let s look at a few of the additions to the SELECT command. Order By When we pulled data from the database table in the query examples earlier, MySQL returned the data in the same order it was placed in the table. For the most part, this works just fine because we just want to get the data out of the database. At other times, it might be important that the data be ordered in some specific fashion. For example, suppose you want to sort the data in ascending order (the default) based on the username: mysql> SELECT * FROM acc ORDER BY username; +———+———–+———-+—————-+ | acc_id | username | password | ts | +———+———–+———-+—————-+ | 1034123 | blewis | lewis | 20021014112252 | | 1034055 | jdoe | doey | 20021014112501 | | 1034034 | jime | NULL | 20021014112415 | | 1034546 | jjmyers | NULL | 20021014113422 | | 1034033 | jsmith | smithy | 20021014112438 | | 1034067 | jthompson | james2 | 20021014113403 | | 1034089 | sstanford | stanford | 20021014113407 | | 1034154 | ysheets | sheets | 20021014113416 | +———+———–+———-+—————-+ 8 rows in set (0.00 sec)
Note: If you are looking for cheapest and affordable webspace to host and run your servlet application check Astra j2ee hosting services