User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 425,899 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,936 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 781 | Replies: 3
Reply
Join Date: Jun 2008
Posts: 1
Reputation: guruOfCool is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
guruOfCool guruOfCool is offline Offline
Newbie Poster

query to skip empty fields

  #1  
Jun 19th, 2008
Hi all,

We're implementing a web-based database application for keeping track of employee emergency information. I need a sql query to select a row, but leave out any fields that are empty (but not null). I've got it working so that all fields in a row are selected. The problem is, I don't know which fields will be empty, so I cannot hard code the select statement to leave out certain fields.
Any help is appreciated.

Thanks.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: query to skip empty fields

  #2  
Jun 19th, 2008
Apparently this means a problem with the db design.

But you may freely post your table's schema together with some sample data.

krs,
tesu
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 770
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 63
R0bb0b's Avatar
R0bb0b R0bb0b is online now Online
Master Poster

Re: query to skip empty fields

  #3  
Jun 21st, 2008
I guess that I don't understand. If you were to make a temporary table out of the data that you want pulled down, what would it look like?
Reply With Quote  
Join Date: Jul 2007
Location: Mumbai(Bombay), India
Posts: 245
Reputation: stephen84s will become famous soon enough stephen84s will become famous soon enough 
Rep Power: 3
Solved Threads: 34
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Posting Whiz in Training

Re: query to skip empty fields

  #4  
Jun 26th, 2008
I've got it working so that all fields in a row are selected. The problem is, I don't know which fields will be empty, so I cannot hard code the select statement to leave out certain fields.

First requirement of its types I have seen, Whats the schema ?

-------------
Shucks dint see the last post was 5 days ago
Last edited by stephen84s : Jun 26th, 2008 at 7:48 am. Reason: Dint see it was a dead thread
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 7:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC