Skip to content
Advertisement

Tag: select

Sqlite get max id not working (?)

Im using this: But my query is empty. I have also tried this (This one works): But obviusly my query only contains the max_id key. What am I doing wrong with the first one? Answer You need to add another level of select for the MAX, like this: A better approach would be to order by id in descending order,

Select a specific index row in sqlite

I have an index and I need to find out what is the row in a table with that index, in SQLite. Example: Index = 1 Table: Which is the correct SELECT that I can use to solve my problem? Answer Typically to get a specific row you can always request them by rowid, e.g. However, there are some atypical

Select info from a table referencing info from another table

I have a main product table with different products. Different products have different specs, so I’ve created separate specs tables for each product (there will be more than ten of them). What I want to do is to show individual product’s specs on a product_page.php whenever the product is clicked. My product page has columns: My specs table columns So

Select by -3 days?

I’m trying to select data from a specific table in my database, but I want to be able to only view the last 3 days worth of data, I have the following code but for some reason I can’t get it to work. Answer You may avoid usage of DATE_ADD() at all: As @OGHaza mentioned, you specified column with alias

Advertisement