vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   exclusive field list (https://vborg.vbsupport.ru/showthread.php?t=81558)

Jakeman 05-16-2005 04:48 AM

exclusive field list
 
Is there a syntax for selecting all fields except those specified?

Code:

SELECT !(field1, field2)
FROM table

You get the idea...

TIA

cinq 05-16-2005 04:54 AM

/me subscribes to thread
I checked this for the longest time and could not find a solution.

Marco van Herwaarden 05-16-2005 08:18 AM

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.

sabret00the 05-16-2005 08:53 AM

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.

Zero Tolerance 05-17-2005 06:51 AM

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 :p

- Zero Tolerance

Jakeman 05-18-2005 04:06 PM

Quote:

Originally Posted by MarcoH64
...This could be only really usefull if these fields contain large amounts of data...

attachment.filedata

Marco van Herwaarden 05-18-2005 05:55 PM

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.

Marco van Herwaarden 05-18-2005 05:58 PM

If you could use only MySQL5, then there would be some other options, but i doubt that is something you can force now.

Jakeman 05-18-2005 10:07 PM

okie thx ;)


All times are GMT. The time now is 01:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01495 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete