sql

querrie is not working out does give any error

Page 1 of 1

2 Replies - 645 Views - Last Post: 19 March 2009 - 02:35 AM Rate Topic: -----

#1 mbabaali  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-December 08

sql

Post icon  Posted 03 December 2008 - 02:54 AM

 select ename ,age
from emp.e,works(w)
where e.eid=w.eid and (w.did or w.did)


the code is not working out what could be the problem?thanks
Is This A Good Question/Topic? 0
  • +

Replies To: sql

#2 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5777
  • View blog
  • Posts: 12,591
  • Joined: 16-October 07

Re: sql

Posted 03 December 2008 - 05:39 AM

This doesn't look like sql

This is closer.
select e.name, age
   from emp e, works w
   where e.eid=w.eid 



Sorry, no idea what "(w.did or w.did)" could possibly mean. You need a condition for boolean resolution, e.g. "w.did=1". In any case, if w.did was actually a boolean somehow, the statement would alway be true.

I'd recommend writing some queries against the database before using them in PHP. That way, you'll get some debug feedback.

This post has been edited by baavgai: 03 December 2008 - 05:39 AM

Was This Post Helpful? 0
  • +
  • -

#3 vipulpatel  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 19-March 09

Re: sql

Posted 19 March 2009 - 02:35 AM

please remove . in table alias and remove () in table alias. Use . at comparision time
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1