SQL help! | xltronic messageboard
 
You are not logged in!

F.A.Q
Log in

Register
  
 
  
 
(nobody)
...and 232 guests

Last 5 registered
Oplandisks
nothingstar
N_loop
yipe
foxtrotromeo

Browse members...
  
 
Members 8025
Messages 2614201
Today 5
Topics 127548
  
 
Messageboard index
SQL help!
 

offline Junktion from Northern Jutland (Denmark) on 2003-05-27 05:16 [#00716316]
Points: 9713 Status: Lurker



I'm about to make a search engine, but I can't figure out
what to write in the SELECT-thingy...
something like this maybe?
SELECT * FROM table WHERE row LIKE 'string'

Is this completly bogus?


 

offline ecnadniarb on 2003-05-27 05:18 [#00716318]
Points: 24805 Status: Lurker | Show recordbag



No that is right...although you would have to do the
comparison on a field rather than the row.


 

offline Junktion from Northern Jutland (Denmark) on 2003-05-27 05:22 [#00716321]
Points: 9713 Status: Lurker | Followup to ecnadniarb: #00716318



my problem is that the searcher (somewhat like the one on
this site), should be able to search from multiple tables
and rows...



 

offline ecnadniarb on 2003-05-27 05:27 [#00716323]
Points: 24805 Status: Lurker | Show recordbag



yes, you just seperate the different tables you want to
search using comma's don't you?


 

offline Junktion from Northern Jutland (Denmark) on 2003-05-27 05:31 [#00716331]
Points: 9713 Status: Lurker



can I write this?

SELECT * FROM table WHERE (row1, row2, row3) LIKE 'string'


 

offline grinningcat from london (United Kingdom) on 2003-05-27 05:36 [#00716342]
Points: 1073 Status: Lurker



try it bruv

sql is a piece of shit. people should just use access!


 

offline Junktion from Northern Jutland (Denmark) on 2003-05-27 05:53 [#00716383]
Points: 9713 Status: Lurker | Followup to grinningcat: #00716342



no access sucks for two reasons. ..1 easy to hack - 2. not
as easy to program to do cool stuff


 

offline alnuit on 2003-05-27 05:53 [#00716384]
Points: 1113 Status: Lurker | Followup to Junktion: #00716331



Nopes. That would gomore like

SELECT * FROM myTable WHERE
myTable.columnA like '%value1%' AND
myTable.columnB like '%value2%' AND
myTable.columnC like '%value3%';


 

offline Junktion from Northern Jutland (Denmark) on 2003-05-27 06:30 [#00716439]
Points: 9713 Status: Lurker | Followup to alnuit: #00716384



cool man thanks...I didnt know if I should use the % or
not...


 

offline thethirdball from Polly Pisspot (Canada) on 2003-05-27 07:38 [#00716482]
Points: 1629 Status: Lurker



Dude,

Although this board is wonderful for many things - SQL
tutorials is not one of them. For a wicked MB about
computer problems - peep - CLICK Arstechnica Openforum.


 

offline Junktion from Northern Jutland (Denmark) on 2003-05-27 07:41 [#00716485]
Points: 9713 Status: Lurker | Followup to thethirdball: #00716482



thanks man ;)


 

offline epohs from )C: on 2003-05-27 07:49 [#00716497]
Points: 17620 Status: Lurker | Followup to Junktion: #00716439



just to kinda answer your question real quick; the % is just
a wildcard character... just like the * in windows. since
you are using the LIKE keyword instead of = you are probably
looking for a string in the middle of a larger string...
not, the exact string; in which case you would use:

SELECT * FROM myTable WHERE
myTable.columnA = 'value1' AND
myTable.columnB = 'value2' AND
myTable.columnC = 'value3';



 


Messageboard index