| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) | |
|
geek
|
MySQL help with long query.
Okay, I have a large sql statement and have highlighted the important sections. I get the error "Unknown column 'name' in 'field list'" I know it has to deal with this part of the statement Code:
But `name` is a field here Code:
But that should work, should it not? Since something similar is done with `brand` As seen in the full sql below. I'm using MySQL 4.1 any ideas or help would be much appreciated. Thank you. Especially if you can point out a better way to do this query. Code:
Quote:
|
|
|
|
|
|
|
#2 (permalink) | |
|
geek
|
That was messy... I decided to modify the database a little so the query would be simpler. Thank you to anyone who looked at this for more then 3 seconds Quote:
|
|
|
|
|
#4 (permalink) | |
|
geek
|
I guess this should go here... but I am am wondering if this is a bug in mysql or if my syntax is just borked Say I have a table called "table" it has two fields called "field" and "real" it's contents are: Code:
I want to sort the table with the nulls at the bottom. I made this query Code:
Which failes saying "Unknown column 'fake' in 'field list'" I found if I change the alias to the name of a field existing in the table in this case "real" it works. Code:
Is this a bug in mysql or is my syntax wrong? Of course using an alias in the above query is useless but this is a simplified example. Any ideas or should I file a bug report? Quote:
|
|
|
![]() |