Re: Possible to get field names and types in a table without executing a query?



On 27.06.2006 17:03, brian.barto@xxxxxxxxxxxxxxxxxxx wrote:

Tried it and it works just fine. I guess I specified no where clause
because I thought a value of a known field would have to be greater,
lesser, or equal to something and I wouldn't be able to depend on the
value of the fields, let alone even knowing their names. Didn't know you
could do THAT, though.

So what does "WHERE 0=1" actually mean? Just curious. :)

- Brian



Exactly that. "Dear SQL Engine, please give me all rows where zero is one." You could also have used "WHERE 'dog' = 'cat'" or "WHERE 'red'='blue'". It's just a twisted way of saying "give me no rows". SQL's SELECT bases on something called "set theory" (http://en.wikipedia.org/wiki/Set_theory), which means that you have to find a way to separate all the rows in your table / view into wanted (the result set) and unwanted ones. Asking for "WHERE 0=1" just makes sure that your result set is empty.

Alexander


--
Alexander Foken
mailto:alexander@xxxxxxxx http://www.foken.de/alexander/

.



Relevant Pages

  • Re: Re :The empty set
    ... "z is an element of the empty set" ... only one, or no, proper classes in a set theory, it also has non-sets ... we PROVE from the axiom schema of separation: ... regularity". ...
    (sci.logic)
  • Re: OT: Questions about Set Theory
    ... I used terms that are used in relation to set theory and I used them ... There was no confusion Snit... ... I have noted that a subset can have zero items (be an ... empty set), such as a subset of items in the above set ...
    (comp.sys.mac.advocacy)
  • Re: Cantor Confusion
    ... Cantor, unless working every digit simultaneously, will never finish. ... Every two paths separate from each other at some ... Pray, provide a proof (within set theory, where we are arguing). ... I am arguing within the tree. ...
    (sci.math)
  • Re: Null-Axiom Set Theory
    ... > example of a set defined in C-B Set Theory? ... is your ur-element the minimal element of the set of all ... nothing is ever empty because it only exists relative to ... Any set with empty being the minimal element is trivially regular in ...
    (sci.logic)
  • Re: JVC direct to hard disk
    ... if he's saying that no TVs with built in mpeg2 decoders that can ... >with all the input cables dangling from the bottom, ... If you mean that you display unit and controller are separate but sold as a unit ... then I wouldn't disagree but I wouldn't agree if you're saying that you have to ...
    (uk.rec.video.digital)