View Full Version : Simple SQL Question
adwaitjoshi
1-29-06, 08:04 PM
I have a SELECT query with some WHERE condition. If the condition is matched it returns a single row. If not then it returns nothing. I am only selecting a "ID" in the SELECT based on a where condition. I always need a value in that ID so if the SELECT returns null value then the ID = NULL. Is is possible to do in the SQL itself? This SQL is a part of many UNIONS and hence there is no way I can check that which row was not returned.
If you are doing joins, then there is no such thing as only one part of it failing. You can't say "this table failed" because you are not asking about that table. You are asking about how that table relates to the data in all of the other tables in your query. I am unsure of exactly what you are asking. Can you try to rephrase your question.
YvetteKuhns
1-30-06, 10:28 AM
I have a SELECT query with some WHERE condition. If the condition is matched it returns a single row. If not then it returns nothing. I am only selecting a "ID" in the SELECT based on a where condition. I always need a value in that ID so if the SELECT returns null value then the ID = NULL.
This sounds like if another value is empty, you want to the id for that row to reassign the id to null. If id is autoincrement, you will have a problem since the value cannot be less than 1.
I am unsure of exactly what you are asking. Can you try to rephrase your question.
adwaitjoshi, I am not sure what you are doing, either. Maybe you can give more information.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.