Skip Data in a SQL query.
Like
mssql_query("SELECT TOP 10 FROM Account SKIP 5");
I just want it that it Selects the TOP 10 After the top 5.
So you echo
6
7
8
9
10
11
12
13
14
15
And the first 12345 not^^
I knew the Function before but I couldn't remember it. Anyway Google didn't help me, I tought I searched wrong =\
Thanks for help
Eele
Re: Skip Data in a SQL query.
um.. how about limit.. like LIMIT 5,1000
Re: Skip Data in a SQL query.
Quote:
Originally Posted by
foxx
um.. how about limit.. like LIMIT 5,1000
That's MySQL, he/she is using MSSQL
Might want to take a look @ Select-SQL
Re: Skip Data in a SQL query.
Quote:
Originally Posted by
Parker
That's MySQL, he/she is using MSSQL
Might want to take a look @
Select-SQL
Thanks I'm gonna see if that should work, I think foxx readed it to fast. I hate it why only MySQL supports the Limit function:P
Re: Skip Data in a SQL query.
In MSSQL you need to use the "top" function
unfortunately it doesn't let you grab a range so you
will have to use normal query with a sub query
to grab ranges.
Re: Skip Data in a SQL query.
postgres also supports limit :D
---------- Post added at 10:11 AM ---------- Previous post was at 10:10 AM ----------
http://www.select-sql.com/mssql/how-...ssql-2005.html
---------- Post added at 10:12 AM ---------- Previous post was at 10:11 AM ----------
oh oups, parker posted it already
Re: Skip Data in a SQL query.
Quote:
Originally Posted by
LegacyCode
In MSSQL you need to use the "top" function
unfortunately it doesn't let you grab a range so you
will have to use normal query with a sub query
to grab ranges.
I have this query already:
PHP Code:
$perpage = 3;
$subquery = "SELECT TOP $perpage * From Character Where DeleteFlag = '0' Order By XP DESC";
$query = mssql_query("SELECT TOP $perpage * FROM ($subquery) Where DeleteFlag = '0' Order By XP DESC");
What did I wrong I have errz again^^
Warning: mssql_query() [function.mssql-query]: message: De syntaxis bij het trefwoord Where is onjuist. (severity 15) in x\x\x\x\x\x.php on line 31
@Foxx
I only had it about the 2 databases, MySQL & MSSQL^^
---------- Post added at 11:04 AM ---------- Previous post was at 10:35 AM ----------
Fixed it.
Ty for comments.