Skip to main content
2 of 4
This ain't no Stack Overflow!
Hannah Vernon
  • 70.5k
  • 22
  • 177
  • 321

PostgreSQL equivalent of mysql construct

Hello Stack Overflow Exchange People

Is there a straightforward way to adapt these types of mySQL queries to postgreSQL:

a) setting variables in MySQL like

set @aintconst = -333

set @arealconst = -9.999

It seems not: https://stackoverflow.com/questions/13316773/is-there-a-way-to-define-a-named-constant-in-a-postgresql-query

b) assigning variables from SELECT queries and using those variables subsequently in my SQL like

select @pfID := id from platform where bios like '%INTEL%'

select @clientID := id from client where platformID = @pfID

I'd be very grateful for pointers, especially b)

Thanks

Daniel
  • 243
  • 1
  • 2
  • 6