Category Archives: SQL

Do Update Now;

Just a couple of minutes ago, I was looking through the wp_posts table and thought enough was enough. There’s a thread over at WordPress where users have been complaining about the bloat and where developers have shrug it off with … Continue reading

Posted in SQL, Wordpress | Tagged | Comments Off on Do Update Now;

Me count(*)

I just finished upgrading to WordPress 2.3: so, curious as any developer would be, I took a look in the WordPress database definitions and noticed that three new tables were added. All of them take care of categories and (the … Continue reading

Posted in SQL, Wordpress | Tagged , , | 1 Comment

Minor-Finer

I added a minor project to the ‘Current Project’ section (Right here), a program in C# that generates classes based on table meta-data. It’s simple and it works: there are a couple of tricks how to collect metadata from ODBC … Continue reading

Posted in Programming, SQL | Tagged , , | Comments Off on Minor-Finer

You asked: How to find count between two dates mssql

Oh: that age old problem. It depends on what you’re looking for? Years, days? Milliseconds? /* Days */ select DATEDIFF(D, getdate(), ’10/11/06′); select DATEDIFF(Y, getdate(), ’10/01/02′); You may need to be careful with using year calculations: obviously MS SQL does … Continue reading

Posted in SQL, You-Asked | 2 Comments

Who slams who?

This article (“The Web is broken and it’s all your fault”) popped up on the Postgres-general list and then made it into Slashdot as ‘Postgres slammed by PHP creator’. The Slashdot thread highlights some interesting PHP flaws and the fact … Continue reading

Posted in Programming, SQL | Comments Off on Who slams who?

Databases

I updated the plug-in accordingly but want to issue a warning before you download it: I’m not sure which version of MySQL does or does not support ‘left outer joins’. I think versions > 3.23 should be able to do … Continue reading

Posted in SQL, Wordpress | Comments Off on Databases

W09

After many moons of bickering and looking around, I decided to take up the gloves and do it myself. Currently I’m using a slightly altered script that ‘automatically’ folds and closes comments after 10 days. This generally works good and … Continue reading

Posted in SQL, Wordpress | 2 Comments

Varchars kill the integers

Iknow several professional applications that use varchar fields to store typically invoice and order numbers, just because it makes it easier to fill this field with non-numerical characters (for example when issuing credit notes and that). This is pretty irritating … Continue reading

Posted in SQL | 2 Comments

I’ve got thread

A threaded query finally is working to run in the background. Update: Previously

Posted in Ordinateurs, SQL | Comments Off on I’ve got thread

Postgres stuff #1

Technical stuff: I have finally some time to break into some specific Postgres stuff and do something for this database as many others have always done for MySQL. Nothing earth-shattering. Here’s the first finding: my personal Postgres (debian) is a … Continue reading

Posted in SQL | Comments Off on Postgres stuff #1

Datestamps, please.

Here is a tip for those aspiring web developers who think that they know it all after they have managed to create a ‘database-driven’ web application: Always add a field to important tables that shows when specific items (or rows) … Continue reading

Posted in SQL | Comments Off on Datestamps, please.

Left Outer Joins

More database stuff: the most exciting stuff of databases is actually analyzing the data afterwards (after the regular integrity checks, naturally). It’s a goldmine, except for that you need to know how to actually capture that data. Here’s a tip … Continue reading

Posted in SQL | Comments Off on Left Outer Joins

Databeast and time

Earlier this week, I thought I had made a crucial mistake when I was testing a couple of new and existing reports on my Debian database server (at home). For some kind of reason, firing up a query that returns … Continue reading

Posted in SQL | Comments Off on Databeast and time