Click here to Skip to main content
16,016,824 members
Home / Discussions / Database
   

Database

 
GeneralRe: CASE when false query Pin
Wendelius17-Feb-09 7:57
mentorWendelius17-Feb-09 7:57 
GeneralRe: CASE when false query Pin
foryou17-Feb-09 22:47
foryou17-Feb-09 22:47 
GeneralRe: CASE when false query Pin
Wendelius18-Feb-09 7:37
mentorWendelius18-Feb-09 7:37 
GeneralRe: CASE when false query Pin
foryou19-Feb-09 1:55
foryou19-Feb-09 1:55 
GeneralRe: CASE when false query Pin
Wendelius19-Feb-09 5:53
mentorWendelius19-Feb-09 5:53 
GeneralFormulas in SQL Server Reporting Services Pin
dboy22116-Feb-09 11:04
dboy22116-Feb-09 11:04 
GeneralRe: Formulas in SQL Server Reporting Services Pin
Diving Flo17-Feb-09 23:44
Diving Flo17-Feb-09 23:44 
QuestionIn search of a better solution... Pin
Jörgen Sigvardsson16-Feb-09 6:50
Jörgen Sigvardsson16-Feb-09 6:50 
Suppose we have a table like this:
CREATE TABLE Slots (
     SlotNumber INT NOT NULL,
     ...,
     PRIMARY KEY(SlotNumber)
);
In this table, a maximum of X slots can be inserted. Given a table with Y rows in it, what is the next available slot?

One solution is to keep a second table with all the slots in it:
CREATE TABLE AllSlots (
     SlotNumber INT NOT NULL,
     PRIMARY KEY(SlotNumber)
);
Then I could do something like
SELECT SlotNumber 
FROM AllSlots 
WHERE SlotNumber NOT IN (SELECT SlotNumber FROM Slots)


Does anybody have a better solution? Note that I have only ANSI SQL in my arsenal (no fancy TSQL/PL1/Whatever constructs are at my disposal)

--
Kein Mitleid Für Die Mehrheit

AnswerRe: In search of a better solution... [modified] Pin
Wendelius16-Feb-09 7:04
mentorWendelius16-Feb-09 7:04 
GeneralRe: In search of a better solution... Pin
Jörgen Sigvardsson16-Feb-09 8:35
Jörgen Sigvardsson16-Feb-09 8:35 
GeneralRe: In search of a better solution... Pin
Wendelius17-Feb-09 1:26
mentorWendelius17-Feb-09 1:26 
GeneralRe: In search of a better solution... Pin
Jörgen Sigvardsson17-Feb-09 1:34
Jörgen Sigvardsson17-Feb-09 1:34 
GeneralRe: In search of a better solution... Pin
Wendelius17-Feb-09 2:10
mentorWendelius17-Feb-09 2:10 
GeneralRe: In search of a better solution... Pin
Jörgen Andersson17-Feb-09 2:53
professionalJörgen Andersson17-Feb-09 2:53 
GeneralRe: In search of a better solution... Pin
Jörgen Sigvardsson17-Feb-09 1:34
Jörgen Sigvardsson17-Feb-09 1:34 
GeneralRe: In search of a better solution... Pin
Wendelius17-Feb-09 2:10
mentorWendelius17-Feb-09 2:10 
AnswerRe: In search of a better solution... Pin
Ennis Ray Lynch, Jr.17-Feb-09 5:15
Ennis Ray Lynch, Jr.17-Feb-09 5:15 
AnswerRe: In search of a better solution... Pin
PIEBALDconsult17-Feb-09 16:15
mvePIEBALDconsult17-Feb-09 16:15 
GeneralRe: In search of a better solution... Pin
Jörgen Sigvardsson17-Feb-09 20:58
Jörgen Sigvardsson17-Feb-09 20:58 
QuestionFull Text Query Pin
Muhammad Fahim Baloch16-Feb-09 4:51
Muhammad Fahim Baloch16-Feb-09 4:51 
GeneralDouble-Post: Full Text Query Pin
Wendelius16-Feb-09 5:06
mentorWendelius16-Feb-09 5:06 
GeneralRe: Ansssssssssssssss meeeeeeeeeeeeee Pin
Muhammad Fahim Baloch16-Feb-09 19:14
Muhammad Fahim Baloch16-Feb-09 19:14 
GeneralRe: Ansssssssssssssss meeeeeeeeeeeeee Pin
Mycroft Holmes16-Feb-09 21:25
professionalMycroft Holmes16-Feb-09 21:25 
GeneralRe: Ansssssssssssssss meeeeeeeeeeeeee Pin
Muhammad Fahim Baloch16-Feb-09 22:14
Muhammad Fahim Baloch16-Feb-09 22:14 
GeneralYou are a fool Pin
Mycroft Holmes16-Feb-09 22:33
professionalMycroft Holmes16-Feb-09 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.