Skip a column

evios

Member
Joined
Jun 3, 2008
Messages
11
Programming Experience
Beginner
How to actually read through a row in the database?
Like if across the rows, if one of the column already exceeds some amount, i no need the other columns already. How can i implement it? Thanks
 
Thread moved.

That's easy, in the SQL statement that pulls the data out of the DB include that limitation in the WHERE clause so the data you have will be data equal to or less than the value on the column
 
Well, you ask a weird question.. You cannot return a variable number of columns from a database query, but you can blank out the ones you dont want:

VB.NET:
SELECT
  CASE WHEN Col1 < 10 THEN Col1 ELSE null END as Col1,
  CASE WHEN Col2 < 10 THEN Col2 ELSE null END as Col2,
  CASE WHEN Col3 < 10 THEN Col3 ELSE null END as Col3,
FROM
  table1
 
How to actually read through a row in the database?
Like if across the rows, if one of the column already exceeds some amount, i no need the other columns already. How can i implement it? Thanks

From my understanding, evios might wish to select rows from a database table where one of its columns having a certain value range. This would be basic SQL records filtering using the WHERE clause.

VB.NET:
SELECT * FROM [I]tablename[/I] WHERE [I]one_of_the_columns[/I] <= '[I]some_amount[/I]'
 
iNdeed, but it's such a poorly worded and ill thought out source question, I wont put serious effort into answering it until it is clarified..
 

Latest posts

Back
Top