home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / delphi / kompon / d456 / JANSQL.ZIP / janSQLDemo / samples.txt.bak.txt < prev    next >
Encoding:
INI File  |  2002-03-25  |  1.2 KB  |  38 lines

  1. [basic select]
  2. select * from users
  3.  
  4.  
  5. select count(userid) as aantal from users
  6.  
  7. create table users (userid,username)
  8.  
  9. insert into users values(1,'Jan Verhoeven')
  10.  
  11. select username from users where userid='1' or userid='2'
  12.  
  13. select username from users where userid=1 or userid=2
  14.  
  15. select users.userid,users.username, products.productname from users,products where users.productid=products.productid
  16.  
  17. insert into users (userid,username) values (600,'user-600')
  18.  
  19. update users set sofi=45
  20.  
  21. select * from users where productid in (select product id from products where productname like 'Ico%')
  22.  
  23. select count(userid), username, productid from users group by productid having userid>10 order by productid
  24.  
  25.  
  26. select products.productname as product,count(users.userid) as quantity from users,products where users.productid=products.productid group by product having quantity>10 order by product desc
  27.  
  28.  
  29.  
  30. select * from users order by #userid asc, productid desc
  31.  
  32.  
  33. select format((userid),'%4.2f') as bob from users
  34.  
  35. select users.username, products.productname, authors.authorname
  36. from users, products, authors
  37. where (users.productid=products.productid) and (products.authorid=authors.authorid) 
  38.