Also how do LEFT JOIN, RIGHT JOIN and FULL JOIN fit in?
Using SQL Server, how do I split a string so I can access item x? Take a string "Hello John Smith". How can I split the string by space and access the item at index 1 which should return "John"?
Table: UserId, Value, Date. I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL?...
Possible Duplicates: How does the SQL injection from the "Bobby Tables" XKCD comic work? https://stackoverflow.com/search?q=sql+injection Can someone explain SQL injection? How ...
I'm looking for an efficient way to convert rows to columns in SQL server, I heard that PIVOT is not very fast, and I need to deal with lot of records. This is my example: -----------------------...
I want to do a Full Outer Join in MySQL. Is this possible? Is a Full Outer Join supported by MySQL?
The following query: SELECT year, id, rate FROM h WHERE year BETWEEN 2000 AND 2009 AND id IN (SELECT rid FROM table2) GROUP BY id, year ORDER BY id, rate DESC yields: year id rate 2006 p01 ...
Lets say I have three different MySQL tables: Table products: id | name 1 Product A 2 Product B Table partners: id | name 1 Partner A 2 Partner B Table sales: partners_id | produ...
For simplicity, assume all relevant fields are NOT NULL. You can do: SELECT table1.this, table2.that, table2.somethingelse FROM table1, table2 WHERE table1.foreignkey = table2.primarykey...
Is there any efficiency difference in an explicit vs implicit inner join? For example: SELECT * FROM table a INNER JOIN table b ON a.id = b.id; vs. SELECT a.*, b.* FROM table a, table b WHERE a.id...