visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: MySql :: query issues


By: roe1and Great Britain  Date: 22/01/2008 15:29:49  English French  Points: 20 Status: Answered
Quality : Excellent
hi, me again.

i'm in the process of converting a foxpro db to mysql and at the moment i'm converting the fox queries? to sql. i need some help. i came across this:

*set filter to (web_ser1=47 or web_ser2=47 or (empty (web_ser2) and web_ser3=47)) and not (cs_id="e5" or cs_id="e6" or cs_id="e7" or cs_id="e8" or cs_id="e9")

so far i have :
SELECT * FROM table WHERE web_ser1='47' OR web_ser2='47' OR (web_ser2 IS NULL AND web_ser3='47') AND cs_id!='e5' AND cs_id!='e6' AND cs_id!='e7' AND cs_id!='e8' AND cs_id!='e9'

i'm not sure what to do about the bit in brackets. any ideas?

By: Nono Date: 26/01/2008 22:15:47 English  Type : Comment
first you could use the IN operator like in "AND cs_is NOT IN ('e5','e6','e7'...)"

then I saw no brackets, sorry ;-)

the idea seems correct and you're right about the SET FILTER dBase meaning : it's a WHERE clause, nothing more. A bit like a VIEW
By: roe1and Date: 28/01/2008 11:57:06 English  Type : Answer
Thanks for your help. my knowledge of sql is not what it should be. my issue is with the (web_ser2 IS NULL AND web_ser3='47'). should this be a seperate sql statement?
By: VGR Date: 02/02/2008 14:14:25 French  Type : Comment
no, it's correctly written this way. you need both conditions for your WHERE clause (SET FILTER TO) to operate correctly.

Do register to be able to answer

EContact
browser fav
page generated in 334.257840 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page