Results 1 to 1 of 1
Related
-
Parse error, parse error unexpected T_variable. Help appreciated! Forum: PHP Forum
Replies: 8 -
mySQL and PHP 1054 error Forum: Databases
Replies: 4 -
DB-Library error: General SQL Server error: Check messages from the SQL Server. Forum: General Discussion
Replies: 0 -
mysql fetch array error please help Forum: PHP Forum
Replies: 10 -
Error connecting to mysql Forum: PHP Forum
Replies: 1
-
10-01-2004, 05:16 AM #1
Error MySQL Error: 1064 - subqueries
I have a problem. I receive this error:
Database error: Invalid SQL: select b.id as category, a.id as link, a.*, 1*(a.showt-a.showc)+ #total search 1*(a.showc) + #total in category 3*(a.hit) as criteria2 from links a right join link_categories b where (category,link,criteria2) in ( select b.id as category, a.id as link, 1*(a.showt-a.showc)+ #total search 1*(a.showc) + #total in category 3*(a.hit) as criteria from links a right join link_categories b on b.id=a.category_id where To_Days(Now()) - TO_Days(a.ldate) > 7 order by criteria asc limit 0, 5) order by criteria2 desc;
MySQL Error: 1064 (You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'where (category,link,criteria2) in ( select b.id as categ)
The SQL statement is:
select b.id as category, a.id as link, a.*,
1*(a.showt-a.showc)+ #total search
1*(a.showc) + #total in category
3*(a.hit)
as criteria2
from links a right join link_categories b
where (category,link,criteria2) in (
select b.id as category, a.id as link,
1*(a.showt-a.showc)+ #total search
1*(a.showc) + #total in category
3*(a.hit)
as criteria
from links a right join link_categories b
on b.id=a.category_id
where To_Days(Now()) - TO_Days(a.ldate) > 7
order by criteria asc
limit 0, 5)
order by criteria2 desc;