Welcome, Guest
Username: Password: Remember me
This is the optional Forum header for the Suggestion Box.

TOPIC: WHERE clause

WHERE clause 3 years 5 months ago #1043

  • daalouw
  • daalouw's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hello.

Before I purchase this software, I want to ensure that it can perform a WHERE clause based on the current user's userid that is logged in.

I have a table that contains several rows for each of my users. Key to the table is "date" and "userid". So, I want to pull back the most current row of data for my user.

Can this software do that?

Regards
daalouw
The administrator has disabled public write access.

Re:WHERE clause 3 years 5 months ago #1044

  • viljem
  • viljem's Avatar
  • OFFLINE
  • Administrator
  • Posts: 178
  • Karma: 0
Hi,

yes, you can do this with Table JX.

If you didn't have date it would be more easier, you would just write in admin area in where section (article that contains this grid is in registered area)
WHERE id=@user_id

You can also write something like this:
WHERE id=@user_id AND latest=True
(if you have column latest that describes the latest row for each user)

But if you don't have the latest column you can create sql view that filters only latest row for each user:

Something like this:

CREATE VIEW myLatestDataForEachUser AS
SELECT id, max(dateColumn)
FROM myTable
GROUP BY id


You display then this view with Table JX and write in WHERE section of admin area:
WHERE id=@user_id

Best regards,
Viljem
The administrator has disabled public write access.
Time to create page: 0.144 seconds