Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 SELECT statement that excludes a field or two?

Author  Topic 

joboy
Starting Member

3 Posts

Posted - 2007-08-01 : 01:10:39
Hi,

While coding (PHP) especially with database transactions, I usually browse the content or check the the table structure directly from the 'terminal' or simply MySQL client. There are times that I want to view the records base on let's say 10 fields, but am interested only on 8 fields. So what command in SQL that explicitly exclude fields from a query or field list? In consequence, I will no longer type in 8 field names but instead a field name or two for exclusions.

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-08-01 : 01:24:02
first, this sounds like a mysql question. This is a SQL Server support forum, so you aren't likely to get much help with MySQL questions.

anyway, there is no syntax to exclude fields in a SELECT. you can SELECT *, or you can SELECT col1, col2, col3, etc. Maybe you can write a PHP function that would do this for you.


-ec
Go to Top of Page

joboy
Starting Member

3 Posts

Posted - 2007-08-01 : 01:39:44
oh, sorry for the wrong post, if not out of being tactless. I should have omit the word MySQL in the statement thus would sound better. Anyway, thanks for your reply.
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-08-01 : 01:47:31
quote:
Originally posted by joboy

oh, sorry for the wrong post, if not out of being tactless. I should have omit the word MySQL in the statement thus would sound better. Anyway, thanks for your reply.



I guess my point was in sql server there is no way to do what you ask. But we are not MySQL experts here, so I cannot say with certainty that that is the case with MySQL.

You should try asking MySQL questions over at dbforums.com instead. they have a very active MySQL forum there.



-ec
Go to Top of Page

joboy
Starting Member

3 Posts

Posted - 2007-08-07 : 01:50:52
Oh I thought It sounds unpleasant. By the way thanks for the link!
Go to Top of Page
   

- Advertisement -