| Subject: | Re: Where clause in SQL server |
|---|---|
| From: | Ian Skinner <iskinner@xxxxxxxxxxx> |
| Date: | Fri, 25 Jul 2008 07:40:08 -0700 |
| Newsgroups: | macromedia.coldfusion.database_access |
emmim44 wrote: Hi all, Can someone explain this to me in plain english? The line ' WHERE 1 = 2 ' If this.team is an empty string then WHERE 1=2. I.E. if no team return no rows because 1=2 will always by false. This code is a bit strange because that type of construct is usually used with AND|OR compound WHERE clauses. I would have possibility written this code in this way. WHERE 1 = 2 <cfif len(trim(this.team)) GT 0>OR CCFTeamID IN (<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#this.Team_ID#" list="yes">) </cfif> I.E. Return no rows unless this.team contains one or more values. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Where clause in SQL server, emmim44 |
|---|---|
| Next by Date: | Re: Where clause in SQL server, emmim44 |
| Previous by Thread: | Where clause in SQL server, emmim44 |
| Next by Thread: | Re: Where clause in SQL server, emmim44 |
| Indexes: | [Date] [Thread] [Top] [All Lists] |