[SQL] Wildcard in date field???
Hello, I need to make a query that will select items that have a date matching the current month for example. For June this means that any day between 2000-06-01 and 2000-06-30 are ok. To do that I need a wildcard like "%" to replace the actual day in the date field. Ex.: select * from item where date = '2000-06-%%'; but that doesn't work... What is the right way? Thanks! -- ~ Marc Andre Paquin
Re: [SQL] order by accents?
Patrick Coulombe wrote: > > hi, > if I do a query like this one : > > SELECT name from medias ORDER BY name > > name > > > > > > > ÉCCC > > 6 rows > > Why the record : ÉCCC is at the end? > HOW can I fix this? > > Thank you > Patrick Hello, I have the same problem (the character is not recognized - we also use french) and it seems that the only way around this "bug" is to install Postgres with a local package... but many told me that is was slower and not very useful... I did not try it. Instead, we plan to create a second column with same french data but without accents... The query will be based on that field for the order by needs... not great, but I will do exactly what we expect and no add-ons. Hope this helps! Bonne journée! -- ~ Marc Andre Paquin
[SQL] two table comparison: find a mismatch?
Hello,
here is to table:
Table "city"
Attribute|Type | Modifier
+-+-
city_id| smallint| not null default
nextval('seq_city'::text)
region_id | smallint|
region_tour_id | smallint|
country_id | smallint|
name_fr| varchar(40) |
name | varchar(40) |
url_id | smallint|
Table "region"
Attribute |Type | Modifier
---+-+--
region_id | smallint| not null default nextval('seq_region'::text)
country_id| smallint|
name_fr | varchar(40) |
name | varchar(40) |
address | boolean |
url_id| smallint|
I whant to fins a "hole" in the linkage... a region number in the city
table is not in the region table any more.
How can I do that?
Where is the city.region_id <> region.region_id
Thanks!
--
~
Marc Andre Paquin
[SQL] select an entry with a NULL date field
Hello, I have a problem with PostgreSQL when I try to select or delete an entry with an empty date. That's a typical entry Table tbl_date - entry_id154 date_012000-01-15 date_02this date is NULL namemy_test - I want to select every entry containing date_02 as NULL I tried : >select entry_id from tbl_date where date_02=NULL; ERROR: parser: parse error at or near "null" >select entry_id from tbl_date where date_02=''; Not work, that's a wrong date format >select entry_id from tbl_date where date_02=""; Not work, "" considered as an attribute Thank you for your time! -- ~ Marc Andre Paquin
