Jump to content

metalpain

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

metalpain's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i would like to filter some results by the top 3 results but i would like to include instances where a result may have the sane value for example a.1, b.2 . c.1, d.3, e.4 so what i would like to do is have a.1, c.1, b.2, d.3 as my final result.
  2. thanks, maybe i should of clarified more, i actually want to remove the later date and have the more recent date as in only haing 1/1/08 instead of 2/2/08,
  3. Hi all i am having trouble understanding the a FIFO concept. i have pusedo waiting list for a houses on a waiting list table, more than two potential tenants can bid for a property what i would like to do is filter the data by a fifo style query based on the start date. i would like some guidance on how to perform this. CREATE TABLE Waiting_list( Waiting# SMALLINT IDENTITY(0001,1) not null, Customer# BIGINT , Property# SMALLINT not null, Tenant# BIGINT, Waiting_Start_date SMALLDATETIME, Waiting_Property_type CHAR(10), Rent_offer SMALLMONEY, CONSTRAINT WAITING_LIST_PK PRIMARY KEY (Waiting#), CONSTRAINT WAITING_PROPERTIES_FK FOREIGN KEY (Property#)REFERENCES Properties(Property#), CONSTRAINT WAITING_TENANT_FK FOREIGN KEY (Tenant#)REFERENCES Tenant(Tenant#), CONSTRAINT WAITING_CUSTOMER_FK FOREIGN KEY (Customer#)REFERENCES Customer(Customer#) ); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200000,15,'House','2008-10-21',150); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200005,2,'Town House','2008-11-1',130); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200010,2,'Unit','2008-10-15',190); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200015,20,'Villa','2008-12-20',200); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200020,18,'House','2008-09-1',200); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200025,19,'Unit','2008-11-01',250); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200030,20,'Unit','2008-09-17',190); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200035,18,'House','2008-12-12',230); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200040,11,'Villa','2008-11-23',210); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200045,16,'House','2008-09-30',250); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200050,22,'Unit','2009-1-1',200); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200055,8,'Villa','2008-11-1',170); INSERT INTO Waiting_list (Customer#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(200060,20,'Unit','2008-10-12',185); INSERT INTO Waiting_list (Tenant#,Property#,Waiting_Property_type,Waiting_Start_date, Rent_offer) VALUES(100018,5,'Town House','2008-11-2',190); EDITed ... for code tags
  4. Hello, I am trying to create a unique primary key that has alpha and numeric values that auto generate, so far i can get the numbers to auto generate but i have no idea how to add alpha characters to it. basic what i want to do is add for example two alpha characters SF in front of the auto incremented numbers so for example SF100000 then SF100001 and so on. is it possible to do this? below is a copy of my script. thankyou. -- Create Staff Table -- CREATE TABLE Staff( Staff# BIGINT IDENTITY(100000,1) not null, Staff_name varchar(25)not null, Staff_surname varchar(25)not null, Staff_phone varchar(10), Staff_Address varchar(50), Staff_postcode numeric (4), Staff_Salary numeric (8,2), Staff_Postion varchar (30), constraint STAFF_PK PRIMARY KEY (staff#) );
  5. Hello, I am trying to create a unique primary key that has alpha and numeric values that auto generate, so far i can get the numbers to auto generate but i have no idea how to add alpha characters to it. basic what i want to do is add for example two alpha characters SF in front of the auto incremented numbers so for example SF100000 then so on. is it possible to do this? below is a copy of my script. thankyou. -- Create Staff Table -- CREATE TABLE Staff( Staff# BIGINT IDENTITY(100000,1) not null, Staff_name varchar(25)not null, Staff_surname varchar(25)not null, Staff_phone varchar(10), Staff_Address varchar(50), Staff_postcode numeric (4), Staff_Salary numeric (8,2), Staff_Postion varchar (30), constraint STAFF_PK PRIMARY KEY (staff#) );
  6. anybody know of any good scripts or tutorials for a simple admin only message board.
  7. Hi im looking to create a simple admin only news/message board where a admin can add, edit and delete news. could some one direct me to some tutorials or scripts please.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.