Databases :: MySql :: query issues |
|||
| By: roe1and |
Date: 22/01/2008 15:29:49 |
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 | 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 | 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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








