• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

wrong query?

 
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I try to get the list of bugs where status IS NOT resoved here is my quesry but it doesn't give me the right answer could you please tell me what part I am wrong?
Many thanks,
Elahe
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your problem probably lies in the 's.text NOT IN ('resolved')' portion of your statement.
The IN keyword usually expects a list of things or a return from another statement.
Try using "s.text != 'resolved" instead.
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bonnie I tried your suggestion but still the answer is not correct
any advice....
Elahe
select s.text,b.bugNumber,b.bdesc,b.submittedDate,b.fixedDate,b.userID,b.contact,u.name from bug b, user u, statusDesc s where b.ID=s.ID and b.userId=u.userId and s.text != 'open' and u.name= 'JDR'
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
select s.text,b.bugNumber,b.bdesc,b.submittedDate,b.fixedDate,b.userID,b.contact,u.name from bug b, user u, statusDesc s where b.ID=s.ID and b.userId=u.userId and s.text != 'resolved' and u.name= 'JDR'
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I fond out on simple query this part:
s.text != 'resolved'
is correct but there is some thing wrong in my whole query that gives me rong resuld!!!
I want my query gives me the list of bug(date, desc,...) that assigned to the persom that name= Jim and status is not resolved.
What did I do wrong?
Thanks,
Elahe
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry name='JDR'
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Elahe, does your query return too many results, not enough, we need more info on what is going wrong to help you. Also, table structures are important when creating a join. Make sure you join on all primary/foreign key pairs. Beware of the cartesian product!
Jamie
 
Elahe Shafie
Ranch Hand
Posts: 291
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jammie and Bonnie,
It works and now I am getting right result.
Thank you sooooo much for your support like always,
Elahe
reply
    Bookmark Topic Watch Topic
  • New Topic