PHP Classes

File: samples/test.txt

Recommend this page to a friend!
  Classes of Tom Schaefer   SQL Parse and Compile   samples/test.txt   Download  
File: samples/test.txt
Role: Auxiliary script
Content type: text/plain
Description: Author's testing statements
Class: SQL Parse and Compile
Parse and compose SQL queries programatically
Author: By
Last change: make accessible
Date: 16 years ago
Size: 1,221 bytes
 

Contents

Class file image Download
// tested with following sql statements

SELECT article, dealer, price
FROM shop s1
WHERE price=(SELECT MAX(s2.price)
              FROM shop s2
              WHERE s1.article = s2.article);


SELECT article, MAX(price) AS price
FROM shop
GROUP BY article


SELECT article, dealer, price
FROM shop
ORDER BY price DESC
LIMIT 1


SELECT MAX(article) AS article FROM shop


SELECT * FROM shop


SELECT s1.article, s1.dealer, s1.price
FROM shop s1
LEFT JOIN shop s2 ON s1.article = s2.article AND s1.price < s2.price
WHERE s2.article IS NULL;


SELECT s.* FROM person p INNER JOIN shirt s
   ON s.owner = p.id
 WHERE p.name LIKE "Lilliana%"
   AND s.color <> "white"
 

SELECT field1_index, field2_index FROM test_table
WHERE field1_index = '1' OR field2_index = '1'


SELECT field1_index, field2_index
    FROM test_table WHERE field1_index = '1'
UNION
SELECT field1_index, field2_index
    FROM test_table WHERE field2_index = '1';


SELECT d_year,d_month,BIT_COUNT(BIT_OR(1<<day)) AS days FROM t1 GROUP BY d_year,d_month;

INSERT INTO person VALUES (NULL, "Antonio Paz")

UPDATE person SET lastname = "Antonio Paz" WHERE id=2

DELETE FROM person WHERE id=2