Tag Info

New answers tagged

3

Sure you CAN do it, but why would you? To save a few CAST expressions? That seems a bit weak. The reasons to have auto incrementing surrogate int PK's are many: You pretty much never have to manage them with normal databases. Ever. Unless you are rebuilding tables or inserting data where you have to turn the identity off and on. But operationally it works ...


1

This would most definitely not be preferred to an auto-increment integer field. For starters: Index width would be degraded significantly with your proposal. Just how do you propose to manage all those random 2-digit integers to enforce uniqueness. Have you thought of how much code would have to be written and maintained to implement this scheme. Won't ...


0

PROPOSED QUERY SELECT B.* FROM (SELECT MAX(changes1.ID) ID,changes1.issue_key FROM `issue_changes` AS changes1 INNER JOIN `issues` AS issue1 ON issue1.`ID` = changes1.`issue_key` WHERE issue1.`project_key` = "bug_tracker" AND changes1.`change_field` = "Status" AND changes1.`change_time` < "1400110321" GROUP BY changes1.issue_key) A LEFT JOIN ...


0

I believe that this is possible in PostgreSQL - try this post here and also here. PostgreSQL is fairly full-featured and if something is not possible in pure SQL, it is in PL/pgSQL. Oracle also has many features and a full featured programming language, see here for example. However, if your experience is with PostgreSQL (and hosting is likelier to be ...



Top 50 recent answers are included