The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Is there a syntax for selecting all fields except those specified?
Code:
SELECT !(field1, field2) FROM table TIA |
#2
|
||||
|
||||
![]()
/me subscribes to thread
I checked this for the longest time and could not find a solution. |
#3
|
|||
|
|||
![]()
Simple answer (if i understand your question correct): No
And what would be the reason for wanting this? Just 1 or 2 fields less to pull from the database without writing out all the fieldnames? This could be only really usefull if these fields contain large amounts of data. You could write a function that does so, but that would probably mean extra queries to create the list, so kinda useless i think. |
#4
|
||||
|
||||
![]()
couldn't you SELECT * NOT_IN(xx,xx)
maybe not, but as marco said, you'd have to either just select the fields or select * and then use php just to grab the ones you want. |
#5
|
||||
|
||||
![]()
I wondered the same thing the other week, when one of vb's queries didn't put a parent onto a field in one of the left joined tables, which caused collision for the table i joined (same field names), but yeah, it can't be done.
Be nice if future mySQL versions had that kind of feature though ![]() - Zero Tolerance |
#6
|
||||
|
||||
![]() Quote:
|
#7
|
|||
|
|||
![]()
Ok, you made your point.
![]() Well the only way i could think of was to use a custom function to dynamyc generate a field list for a given table, and then to return the list of fields, with the exception of the excluded ones. But it would require at least queries to process. This could be easilly written as a PHP function to be used in the sources. With some effort it might even be doable in SQL, but doubt that would be the optimal solution. |
#8
|
|||
|
|||
![]()
If you could use only MySQL5, then there would be some other options, but i doubt that is something you can force now.
|
#9
|
||||
|
||||
![]()
okie thx
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|