We have 36 guests online
PHP Scripts arrow Free PHP Tutorials arrow Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP 
Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP

Basic SELECT query in MySQL
User Rating: / 9
PoorBest 
  1. # fetch field1 and field2 from all rows in myTable
  2. SELECT field1, field2 FROM myTable;
  3.  
  4. # only rows where field1 is greater than 10
  5. SELECT field1, field2 FROM myTable WHERE field1 > 10;
  6.  
  7. # select field1 and the total number of all unique field1s from myTable
  8. SELECT field1, count(field1) AS total FROM myTable GROUP BY field1;
  9.  
  10. # those with a count(field1) equaling 5
  11. SELECT field1, count(field1) AS total FROM myTable GROUP BY field1 HAVING total = 5;

 

 

Directory Stats

There are 905 listing and 46 categories in our website

Change Language