Login    Forum    Search    FAQ   Blog

Board index » Server Side Development » SQL




 Page 1 of 1 [ 5 posts ] 



Author Message
 Post subject: Issue reagardin a select statement
 Post Posted: Tue Nov 17, 2009 12:16 pm 
Offline

Joined: Sat Feb 21, 2009 12:32 pm
Posts: 81
I have been tryin 2 find all match critera wid out the KEY0 dat starts
with was nd a Settype dat begins wid a '*". howevr In ma query all the time
comes up wid a mixture of was and *.

wer was i wrong!!! :D

thanks in advance

Code:
SELECT KEY0, BU + '-' + DIV AS Expr1, TYPE, SETTYPE, FR_GR
FROM dbo.TESIS2
WHERE (type = 'cell') OR
(type = 'cel') OR
(type = 'cdma') OR
(type = 'gprs')
ORDER BY BU, DIV, KEY0;

(SELECT KEY0, BU, DIV AS Expr1, TYPE, SETTYPE, FR_GR
FROM dbo.TESIS2
WHERE (settype NOT LIKE '*%') AND (KEY0 NOT LIKE 'WAS%'))


Top 
 Post subject: Re: Issue reagardin a select statement
 Post Posted: Tue Nov 17, 2009 12:16 pm 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
want 2 post some sample data nd wat the expected results must be


Top 
 Post subject: Re: Issue reagardin a select statement
 Post Posted: Tue Nov 17, 2009 12:17 pm 
Offline

Joined: Sat Feb 21, 2009 1:08 pm
Posts: 549
Code:
SELECT      KEY0,
      BU + '-' + DIV AS Expr1,
      TYPE,
      SETTYPE,
      FR_GR
FROM      dbo.TESIS2
WHERE      type IN ('cell', 'cel', 'cdma', 'gprs')
ORDER BY   BU,
      DIV,
      KEY0

SELECT   KEY0,
   BU + '-' + DIV AS Expr1,
   TYPE,
   SETTYPE,
   FR_GR
FROM   dbo.TESIS2
WHERE   NOT (settype LIKE '*%' OR KEY0 LIKE 'WAS%')


QQ--I dont need to see
was
414-4259 8930-0000 CEL *MOTQ FR804610 (was and *)
howevr

414-4259 8930-0000 CEL *MOTQ FR804610
or
was 414-4259 8930-0000 CEL MOTQ FR804610
is fine 2 see


Top 
 Post subject: Re: Issue reagardin a select statement
 Post Posted: Tue Nov 17, 2009 12:18 pm 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
Change da OR to AND?


Top 
 Post subject: Re: Issue reagardin a select statement
 Post Posted: Tue Nov 17, 2009 12:18 pm 
Offline

Joined: Sat Feb 21, 2009 12:32 pm
Posts: 81
thanks dat was wat I ended up the doing.

thanks for da help, this forum was really great!


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 5 posts ] 




Board index » Server Side Development » SQL


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron