Click here to Skip to main content
15,910,210 members
Home / Discussions / Database
   

Database

 
GeneralRe: mysql query to insert 0's Pin
eraser95021-Sep-10 19:56
eraser95021-Sep-10 19:56 
GeneralRe: mysql query to insert 0's Pin
dan!sh 21-Sep-10 20:47
professional dan!sh 21-Sep-10 20:47 
GeneralRe: mysql query to insert 0's Pin
eraser95022-Sep-10 6:27
eraser95022-Sep-10 6:27 
GeneralRe: mysql query to insert 0's Pin
dan!sh 22-Sep-10 11:53
professional dan!sh 22-Sep-10 11:53 
GeneralRe: mysql query to insert 0's Pin
Mycroft Holmes22-Sep-10 13:11
professionalMycroft Holmes22-Sep-10 13:11 
GeneralRe: mysql query to insert 0's Pin
Pete O'Hanlon24-Sep-10 4:34
mvePete O'Hanlon24-Sep-10 4:34 
GeneralRe: mysql query to insert 0's Pin
David Skelly21-Sep-10 6:00
David Skelly21-Sep-10 6:00 
AnswerRe: mysql query to insert 0's Pin
bigbadben30-Sep-10 3:25
bigbadben30-Sep-10 3:25 
I assume mysql has similar sorts of functions but I have not had the pleasure, but in T-SQL / SQL Server you could do:

select ID = right('0000000' + convert(varchar(20),ID),7) from MyTable -- ID can be int or varchar
or
select ID = right('0000000' + ID,7) from MyTable -- OK only when ID is varchar.

Likewise you could put this into an update statement if for example you are in the process of converting your ID column from type int to varchar/text etc.
QuestionPrevent Duplicate Entry while update Pin
eraser95020-Sep-10 21:18
eraser95020-Sep-10 21:18 
AnswerRe: Prevent Duplicate Entry while update Pin
Bernhard Hiller21-Sep-10 2:08
Bernhard Hiller21-Sep-10 2:08 
GeneralRe: Prevent Duplicate Entry while update Pin
eraser95021-Sep-10 19:53
eraser95021-Sep-10 19:53 
GeneralRe: Prevent Duplicate Entry while update Pin
eraser95022-Sep-10 0:33
eraser95022-Sep-10 0:33 
Questionhelping writing sql query Pin
michaelgr120-Sep-10 2:49
michaelgr120-Sep-10 2:49 
AnswerRe: helping writing sql query [modified] Pin
Blue_Boy20-Sep-10 3:07
Blue_Boy20-Sep-10 3:07 
AnswerRe: helping writing sql query Pin
PIEBALDconsult20-Sep-10 3:18
mvePIEBALDconsult20-Sep-10 3:18 
GeneralRe: helping writing sql query Pin
michaelgr120-Sep-10 3:21
michaelgr120-Sep-10 3:21 
AnswerRe: helping writing sql query Pin
Pete O'Hanlon20-Sep-10 6:47
mvePete O'Hanlon20-Sep-10 6:47 
AnswerRe: helping writing sql query Pin
RyanEK20-Sep-10 17:40
RyanEK20-Sep-10 17:40 
GeneralRe: helping writing sql query Pin
Mycroft Holmes20-Sep-10 21:05
professionalMycroft Holmes20-Sep-10 21:05 
AnswerRe: helping writing sql query Pin
i.j.russell20-Sep-10 21:18
i.j.russell20-Sep-10 21:18 
GeneralRe: helping writing sql query Pin
Mycroft Holmes21-Sep-10 3:49
professionalMycroft Holmes21-Sep-10 3:49 
Questioncomplex sql query Pin
abhi29198418-Sep-10 12:20
abhi29198418-Sep-10 12:20 
AnswerRe: complex sql query Pin
Andy_L_J18-Sep-10 13:07
Andy_L_J18-Sep-10 13:07 
AnswerRe: complex sql query Pin
Mycroft Holmes18-Sep-10 13:35
professionalMycroft Holmes18-Sep-10 13:35 
AnswerRe: complex sql query Pin
abhi29198419-Sep-10 0:23
abhi29198419-Sep-10 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.