PDA

View Full Version : Evil SQL question


The New Jersey Devil
2004.01.27, 04:42 PM
Why doesn't this work?
Select * from Posts where PARENT=ID

AndrewSage
2004.01.27, 05:23 PM
Without knowing more about your setup I can only ask the following:

Does the table Posts exist?
Does the table Posts contain the field PARENT?
Does ID exist?

Josh
2004.01.27, 09:24 PM
What SQL is this? Is PARENT really PARENT and not parent or Parent? Is ID really ID and not id? Should there be ' ' around whatever ID is? Should the statement end with a semicolon? Is this a command line thing, or a web thing?

anarchie
2004.01.28, 11:13 AM
Did you forget the semicolon?

MattDiamond
2004.01.28, 02:29 PM
You don't always need a semicolon (depends on how the statement is being run.)

Bottom line: we need to know what the table looks like and what Daniel is trying to get out of it before we can help.

Josh
2004.01.28, 09:05 PM
You don't always need a semicolon (depends on how the statement is being run.)And the SQL flavor ;) But yes, we need much more info.

DoG
2004.01.29, 05:13 AM
I assume your "ID" is not in the same table, wouldn't make too much sense otherwise. In that case, you have to specify the other table you are using or give a number instead of ID.