Ok. I created your table and populated it thus:
create table labbranch
(
labid int,
name varchar(50),
address varchar(50),
phone varchar(50),
sizeoflab int,
totaldeskspace int
);
insert into labbranch values(1,'Lab1','@Lab1','111', 99, 99);
insert into labbranch values(2,'Lab2','@Lab2','222', 100, 100);
insert into labbranch values(3,'Lab3','@Lab3','333', 101, 101);
Note that the table has 6
columns (not rows) and 3
rows (entries)
Your requirements are
Quote:
selects the ones that are equal to or over 100m
So my expected results based on your description are to get details for Lab2 and Lab3.
When I run the query you have already tried I get an error message:
Quote:
TypeError: Unable to get property 'substring' of undefined or null reference
This is because you do not have a table called
lab
. Fix that by using the correct table name:
SELECT sizeoflab
FROM labbranch
WHERE sizeoflab=100;
When I run that I get a single number, 100, returned. From my expected results I wanted 2 rows not one, and there isn't any useful information in the results I currently have either.
So change it to
SELECT labid, name, sizeoflab FROM labbranch
WHERE sizeoflab >= 100;
Which gives the results:
labid name sizeoflab
2 Lab2 100
3 Lab3 101