|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
problem with query
1.select * from m_plan_subdesc SD where SD.plan_subdesc_id in(select plan_subdesc_id from m_planVsubdesc where plan_id=1 and plan_desc_id=1)
if i run this query at server it dosen't work but if i run same query at local mysql ,it works. and if i divide this query even it works i.e. if i run first sub query 2 .(select plan_subdesc_id from m_planVsubdesc where plan_id=1 and plan_desc_id=1) then it works and gives result then using that result i run main query 3 .select * from m_plan_subdesc SD where SD.plan_subdesc_id in(Result of subquery) then also it works but if i try the complete above mentioned in 1 query it doesn't works. so if any one can have some idea for this problem please help me. |
|
#2
|
|||
|
|||
|
Check what version your server's running. Subqueries only work in 4.1 and above. You should be able to use a join, though:
Code:
SELECT sd.foo ,sd.bar FROM m_plan_subdesc sd INNER JOIN m_planVsubdesc sv ON sd.plan_subdesc_id = sv.plan_subdesc_id WHERE sv.plan_id=1 AND sv.plan_desc_id=1
__________________
"A pawn is the most important piece on the chessboard -- to a pawn" |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > problem with query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|