Explain a SELECT statement for MySQL
someone can explain me what this query does?
$sql=mysql_query("SELECT b.id, b.data FROM data_parent a, data b WHERE b.id=a.did and parent='$id'");
it works but honestly i didn't unde开发者_运维百科rstand.
Thanks
- Take the table data_parentand alias it asa.
- Take the table dataand alias it asb.
- Match values in awith those inbon theidcolumn inband thedidcolumn ina.
- Filter for rows in [some table since it isn't specified] such that the column parentis equal to some passed in value.
- From those results, display the idanddatacolumns fromb
The query grabs the COlumns ID & Data from the Data table where the data_parentID is the same as the data table id. And it is based on for 1 parent ID
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论