Tag: DatabasesParents:
Children:
Solution 1: SQL Server Equivalent To MySQL And PostgreSQL Limit Clause - Joseph Scott’s Blog. Note: assumes unique keys.
SELECT TOP n *
FROM tablename
WHERE key NOT IN (
SELECT TOP x key
FROM tablename
ORDER BY key
)
Solution 2: Finally a LIMIT clause for MS SQL. (Same solution recommended here, with a small explanation.)
select * from (
select top 10 emp_id,lname,fname from (
select top 30 emp_id,lname,fname
from employee
order by lname asc
) as newtbl order by lname desc
) as newtbl2 order by lname asc
Edit: The above is in SQL Server 2k... for 2005 there's a new row_number() function.
-
CouchDB "Joins" (via). Figuring out how to do joins in a non-relational db. To finish reading.
¶ (0)
Tags: [Databases]
-
DBSlayer (via).
The DBacesslayer aka DBSlayer aka Släyer (as we like to call it when we're feeling ironically heavy metal) is a lightweight database abstraction layer suitable for high-load websites where you need the scalable advantages of connection pooling. Written in C for speed, DBSlayer talks to clients via JSON over HTTP, meaning it's simple to monitor and can swiftly interoperate with any web framework you choose.
¶ (0)
Tags: [Databases, Json]
-
jamtronix: Example of connecting to SQL Server via Ruby.
¶
Tags: [Databases, Ruby]
-
Sequel: Lightweight ORM library for Ruby (via).
¶ (0)
Tags: [Databases, Ruby]
-
Set Field to Null in Sql Server Enterprise Manager Result Set - Wes' Puzzling Blog. There we go, couldn't remember the keyboard shortcut. It's CTRL+0.
¶ (0)
Tags: [Databases]
-
Change Owner of an Object in SQL Server 2000 - Erik Porter's Blog
¶ (0)
Tags: [Databases]
-
SQLyog is an open source (here's the project on Google code) MySQL administration GUI. I just used it to reorder some fields in a table -- I've been wanting something with that feature for a while.
¶ (0)
Tags: [MySQL, Software]
-
Kexi Project - "Microsoft Access for Linux". Also has a Windows distro. Screenshots are pretty; haven't tried.
¶ (0)
Tags: [Databases, Software]
-
SQL Server Dumper. Let's you dump SQL Server tables like mysqldump lets you do for MySQL. Unfortunately, it's not scriptable. I'm not sure what SQL Server has built-in to dump tables, but if you need something just once or infrequently this should work for you.
¶ (0)
Tags: [Databases, Software]
-
ADO Connection Strings. Also see ConnectionStrings.com. And here are two more.
¶ (0)
Tags: [Databases]
-
IBM developerWorks: Exploring Active Record.
Active Record [is] the persistence engine behind Ruby on Rails. Active Record bucks many Java conventions, from the typical configuration mechanisms to fundamental architectural choices. The result is a framework that embraces radical compromises and fosters radical productivity.
To read.
¶
Tags: [Object-Relational mapping, Ruby on Rails, To Read]
-
ConnectionStrings.com - Forgot that connection string? You will find it right here!
¶ (0)
Tags: [Databases]
-
Epsilon-Delta: Mathematics and Computer Programming » Dissecting MySQL Fulltext Indexing (via Matt Mullenweg). To read.
¶ (0)
Tags: [MySQL, Programming]
-
Comparison of different SQL implementations (via Ned Batchelder). Could come in handy.
¶ (0)
Tags: [Databases]
-
SQLObject. Gonna investigate for a project.
Update: Heh, SQLObject won't work for me. So, I'm going from the most abstracted interface possible to the most low-level available.
¶
Tags: [Object-Relational mapping, Programming]
-
MySQL Reference Manual :: A.2.8 MySQL server has gone away. If you get that error while trying to do a large import, change the max_allowed_packet setting to something big enough to be able to cover your largest SQL statement in the import file. This is usually a problem when you export your data with MySQL's extended SQL insert format, since an entire table results in just one insert statement.
¶ (0)
Tags: [MySQL]
I'm normalizing some database tables more than I was hoping to get away with. I would have gotten away with it too, if it wasn't for you meddling kids... er, if I didn't need the ability to rename what I was planning to make a key.
Because MySQL doesn't support subqueries (if there was ever a case of worse-is-better, it's PHP and MySQL), the following very simple query:
UPDATE Bookmark_Keywords SET Bookmark_Keyword_Id = (
SELECT Bookmark_Keyword_Id
FROM Bookmark_Keyword_Info
WHERE Bookmark_Keyword_Name = Bookmark_Keyword
)
is going to require that I write procedural code to update the table. Bust.
Update: For future reference, here's the code I had to write:
<?php $sql = 'SELECT DISTINCT Bookmark_Keyword_Info.Bookmark_Keyword_Id id, Bookmark_Keyword_Name name FROM Bookmark_Keyword_Info INNER JOIN Bookmark_Keywords ON(Bookmark_Keyword_Name = Bookmark_Keyword) ORDER BY Bookmark_Keyword_Name'; //reformatted to fit layout $rs_id = mysql_query($sql, $conn) or die("Couldn't select your keywords: ".mysql_error()); while($row = mysql_fetch_assoc($rs_id)){ $sql = "UPDATE Bookmark_Keywords SET Bookmark_Keyword_Id = $row[id] WHERE Bookmark_Keyword = '$row[name]'"; // reformatted to fit layout print_r($row); echo '<br> '; print_r($sql); mysql_query($sql, $conn) or die("Couldn't update your table: ".mysql_error()); echo '<br>'; } ?>
Any formatting in there (print_r, echo), etc., was for me to see that the right thing was going to happen before I uncommented the mysql_query line. And of course, this is just "one-off" code... for instance, I didn't addslashes() on $row[name] because I knew none of my names had slashes or quotes in them.
|
Generated in about 0.228s. (Used 11 db queries) |
"IMDB for music"
IMDB for Music? It looks to be acouple of years old...http://MusicTell.co...
Ken Empie: May 14, 9:57pm