Jump to content

SQL'de LIKE ile Birden Fazla Sütundan Veri Çekmek


KintaRo
 Share

Recommended Posts

3 tane sütunumuz var diyelim ve LIKE kullanarak 3 ayrı kelime ile bu sütnlardan nasıl arama yaparız?

isim soyad adres
---- ----- -----
ahmet soyer istanbul
mehmet soylu hatay
osman mümtaz ankara

ornek tablomuz bu

isminde %ahm% soyadında %soy% ve adresinde %ist% geçenleri tek seferde nasıl sorgularız?
Link to comment
Share on other sites

Tablom şu şekilde:

[img]http://i.imgur.com/SLY6r.png[/img]

Verdiğin kodlarıda şu şekilde entegre ettim:

[codebox]SQLite3Cursor, err = SQLite3Connection:execute("SELECT * FROM tablo WHERE mahalle LIKE '%".. sMahalle .."%' AND cadde LIKE '%".. sCadde .."%' AND sokak LIKE '%".. sSokak .."%' AND kume LIKE '%".. sKume .."%'")
if SQLite3Cursor ~= nil then
tVeri = SQLite3Cursor:fetch({}, "a")
while tVeri do
TreeList.AddRow("Plugin1", tVeri.tarih .. "|" .. tVeri.mahalle .. "|" .. tVeri.cadde .. "|" .. tVeri.sokak .. "|" .. tVeri.kume, nil, nil, tVeri.id)
tVeri = SQLite3Cursor:fetch(tVeri,"a")
end
end
end[/codebox]

ama yine olmadı.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...