Hello B4X community,
I have a question concerning an sql query.
I always need to get a minimum number of returned rows in an sql query. If the number
of the returned rows is under a defined number I have to add dummy rows.
If the sql query returns the defined number of rows or more, then there is no need to add extra rows.
The defined number is a variable and can change.
Example (in this case the number of minimum returned rows is 5):
Table rooms
"select id, room from rooms" would return the following:
1 room1
2 room2
3 room3
but I need something like that:
1 room1
2 room2
3 room3
0 empty
0 empty
Table rooms
In this case there is no need to add extra rows because the number of result rows is > 5.
1 room1
2 room2
3 room3
4 room4
5 room5
6 room6
Any idea?
Kind regards
h725
I have a question concerning an sql query.
I always need to get a minimum number of returned rows in an sql query. If the number
of the returned rows is under a defined number I have to add dummy rows.
If the sql query returns the defined number of rows or more, then there is no need to add extra rows.
The defined number is a variable and can change.
Example (in this case the number of minimum returned rows is 5):
Table rooms
id | room |
1 | Room 1 |
2 | Room 2 |
3 | Room 3 |
"select id, room from rooms" would return the following:
1 room1
2 room2
3 room3
but I need something like that:
1 room1
2 room2
3 room3
0 empty
0 empty
Table rooms
id | room |
1 | Room1 |
2 | Room2 |
3 | Room3 |
4 | Room4 |
5 | Room5 |
6 | Room6 |
In this case there is no need to add extra rows because the number of result rows is > 5.
1 room1
2 room2
3 room3
4 room4
5 room5
6 room6
Any idea?
Kind regards
h725
Last edited: