Python Forum

Full Version: SQLALCHEMY - Not selecting data from table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I thought it best to create a new thread instead of replying to the old one. Basically I'm querying a Postgresql server using SQLAlchemy. The issue I have is that for some reason it's not pulling through any results. Now this issue isn't exactly python related as I've tried it using the query tool on PGAdmin 4 and it also pulls no results.

Data example:
Output:
style_no style_no_size 12-2408-08 12-2408-08:10 12-2408-08 12-2408-08:20 12-2408-08 12-2408-08:29
The code is running

Output:
select style_no where style_no_size = '12-2408-08:29'
and it's pulling nothing through, even when I try the opposite.

If anyone can help then I would really appreciate it.

Thanks,
James
try: select style_no where style_no_size like '12-2048-08%29';
also: select style_no where style_no_size like '%12-2048-08%';
see if you get a result
(Nov-01-2021, 11:39 AM)jamesaarr Wrote: [ -> ]select style_no where style_no_size = '12-2408-08:29'
Where is the "from" clause? Should there not be "from <tablename>" in the query?
(Nov-02-2021, 08:24 AM)ibreeden Wrote: [ -> ]
(Nov-01-2021, 11:39 AM)jamesaarr Wrote: [ -> ]select style_no where style_no_size = '12-2408-08:29'
Where is the "from" clause? Should there not be "from <tablename>" in the query?

Hi,

Yeah I just didn't write the from in on this thread.

I got it fixed in the end by doing:

select data from table where column = '%%data%%';
jamesaarr Wrote:Yeah I just didn't write the from in on this thread.
And I copied your error, sorry