List:General Discussion« Previous MessageNext Message »
From:Pooly Date:September 17 2005 8:53pm
Subject:Re: Select ALL rows with WHERE statement
View as plain text  
2005/9/17, Alvaro Cobo <coboalvaro@stripped>:
> 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.
> 

You need to select all rows, but you have only control on the
condition on flied1, I am right ?
If you can input %, it should do the trick.
select * from table WHERE field1 like '%';
Why can't you do just 
select * from table ??


-- 
Pooly
Webzine Rock : http://www.w-fenec.org/
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