List:General Discussion« Previous MessageNext Message »
From:Alvaro Cobo Date:September 17 2005 8:44pm
Subject:Select ALL rows with WHERE statement
View as plain text  
Hi all: 

I've searched into the MySQL manual but I can't find the solution to this very silly
question. 

I have a select query where I need to filter the data using the WHERE statement. But also
need to have an option to show all the data in the table. 

For example (something like...): 

SELECT * FROM `tbl_table1`  WHERE field1 = 'Test' #To show all the rows where field 1=
'Test'

But also have the choice to select all the rows using something like: 

SELECT * FROM `tbl_table1`  WHERE field1 = * or ALL or %  #Select all the fields.

Very thankful in advance. 

Alvaro

PD: System Details: Mysql server version 4.1.11, PHP 4.3.10-2, Debian Sarge. 
Thread
Select ALL rows with WHERE statementAlvaro Cobo17 Sep
  • Re: Select ALL rows with WHERE statementPooly17 Sep
  • Re: Select ALL rows with WHERE statementPeter Brawley17 Sep
  • Re: Select ALL rows with WHERE statementAlvaro Cobo18 Sep
    • Re: Select ALL rows with WHERE statementJasper Bryant-Greene18 Sep
      • Re: Select ALL rows with WHERE statementPooly18 Sep
    • Re: Select ALL rows with WHERE statementPeter Brawley18 Sep