SQLite操作メモ version 8

2019/05/08 10:19 by yamasyuh68
  :追加された部分   :削除された部分
(差分が大きい場合、文字単位では表示しません)
SQLite入門
SQLite入門
https://www.dbonline.jp/sqlite/

# where

Like
select * from user where address = 'Tokyo'; 

c.execute('select * from musics where title=? ' , '') 

print(c.fetchall())


# Like

select * from user where address like 'S%';
              ----       -------       ---
              table       column     expression

特殊文字
%  任意の0文字以上の文字列
_  任意の1文字

否定
select * from user where name not like '_____'; 

エスケープ
select * from mytable where mycolumn like '%10$%' escape '$'
 この例は $ をエスケープ文字にしている
      

SQLite入門
https://www.dbonline.jp/sqlite/

where

select * from user where address = 'Tokyo';

c.execute('select * from musics where title=? ' , '')

print(c.fetchall())

Like

select * from user where address like 'S%';
---- ------- ---
table column expression

特殊文字
% 任意の0文字以上の文字列
_ 任意の1文字

否定
select * from user where name not like '_____';

エスケープ
select * from mytable where mycolumn like '%10\(%' escape '\) '
この例は $ をエスケープ文字にしている